日期:2014-05-16  浏览次数:20302 次

JS中取得的关于窗口宽高和滚动值的属性列表:(转载)

首先,这是个痛苦的尝试。
  在工作中尝试把一个FLASH居中全屏放置,窗口RESIZE的时候和页面SCROLL的时候都要动态变化,需要取得当前窗口显示区域的WIDTH与HEIGHT,翻了翻资料脑子就一半面一半水搅匀了。类似的参数我全列出来:

window.screen.width: document.body.offsetWidth: document.documentElement.offsetWidth:
window.screen.height: document.body.offsetHeight: document.documentElement.offsetHeight:
window.screen.availWidth: document.body.scrollWidth: document.documentElement.scrollWidth:
window.screen.availHeight: document.body.scrollHeight: document.documentElement.scrollHeight:
window.scrollMaxX: