javascript 屏幕分辨率问题 我的显示器设定的 分辨率是2048*1152的 可是为什么我用 screan.width得到的数据是1966×1106啊 请各位牛人指点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 本人也好奇,availHeight 获取系统屏幕的工作区域高度,排除 Microsoft® Windows® 任务栏。 availWidth 获取系统屏幕的工作区域宽度,排除 Windows 任务栏。 再复核一下值是否正确。 忘了说了 这个问题用firefox debug 就不会发生 是IE的问题? function getScreenSize(){ var theWidth,theHeight; if (window.innerWidth) { theWidth = window.innerWidth theHeight = window.innerHeight } else if (document.compatMode=='CSS1Compat') { theWidth = document.documentElement.clientWidth theHeight = document.documentElement.clientHeight } else if (document.body) { theWidth = document.body.clientWidth theHeight = document.body.clientHeight } var result = [theWidth,theHeight]; return result;}alert(getScreenSize()[0])//宽alert(getScreenSize()[1])//高 to:aspwebchh你这个是用来获取浏览器工作 区域的宽和高的。 截取一个字符串内,指定两个字符之间的字符串, 并存入数组 初学者,问点方法!谢谢你了 求解!JS 问题! 帮我看看这个问题,我初学javascript。 鼠标放在图片上显示大图 明文传参中标签内有&&&&&符号,就取不到后面参数的值啦 怎么办啊 js replace 问题 如何使Iframe中的元素可编辑? 如何屏蔽掉F5也就是刷新键 这句话有问题吗? jquery ui slider的滑块怎么改个样式啊 看看怎么改三件联动!!!
availHeight 获取系统屏幕的工作区域高度,排除 Microsoft® Windows® 任务栏。
availWidth 获取系统屏幕的工作区域宽度,排除 Windows 任务栏。
再复核一下值是否正确。
{
var theWidth,theHeight;
if (window.innerWidth)
{
theWidth = window.innerWidth
theHeight = window.innerHeight
}
else if (document.compatMode=='CSS1Compat')
{
theWidth = document.documentElement.clientWidth
theHeight = document.documentElement.clientHeight
}
else if (document.body)
{
theWidth = document.body.clientWidth
theHeight = document.body.clientHeight
}
var result = [theWidth,theHeight];
return result;
}alert(getScreenSize()[0])//宽
alert(getScreenSize()[1])//高