转自
http://zhidao.baidu.com/link?url=2NZqkma2IoWC2tK3lK-6btiktAWItFVw6VSjDOKzYbOTrP4Ab0wp-r1sEz7Mzr_pOoRKNBUw993TKuJ3ox0MVh1P-ydxu6pMwdSgRYzUfRC
很有用
这样可以按照自己的要求进行定位
strInfo+=\r\n网页可见区域高:+document.body.clientHeight; strInfo+=\r\n网页可见区域宽:+document.body.offsetWidth+(包括边线的宽); strInfo+=\r\n网页可见区域高:+document.body.offsetHeight+(包括边线的高); strInfo+=\r\n网页正文全文宽:+document.body.scrollWidth; strInfo+=\r\n网页正文全文高:+document.body.scrollHeight; strInfo+=\r\n网页被卷去的高:+document.body.scrollTop; strInfo+=\r\n网页被卷去的左:+document.body.scrollLeft; strInfo+=\r\n网页正文部分上:+window.screenTop; strInfo+=\r\n网页正文部分左:+window.screenLeft; strInfo+=\r\n屏幕分辨率的高:+window.screen.height; strInfo+=\r\n屏幕分辨率的宽:+window.screen.width; strInfo+=\r\n屏幕可用工作区高度:+window.screen.availHeight; strInfo+=\r\n屏幕可用工作区宽度:+window.screen.availWidth; window.confirm(strInfo); </script ----------------------------------------------------------------------------------------- 最近编程中发现html静态页面的开发可以使用 document.body.ClientHeight 来获得页面的高度,但asp.net的页面却无法这样获取,获取到的只是页面最小的高度,比如页面只有一个button,那么该js语句获得的就是24。 document.documentElement.OffsetHeight ----------------------------------------------------------------------------------------加上document.body.scrollLeft; document.body.scrollTop; x=document.body.clientWidth+document.body.scrollLeft; y=document.body.clientHeight+document.body.scrollTop;若想得到整个页面的高度可以用