js 获取页面高度和宽度兼容 ie firefox chrome等
摘要:复制代码代码如下://得到页面高度varyScroll=(document.documentElement.scrollHeight>doc...
复制代码 代码如下:
<script>
//得到页面高度
var yScroll = (document.documentElement.scrollHeight >document.documentElement.clientHeight) ? document.documentElement.scrollHeight : document.documentElement.clientHeight;
alert(yScroll)
//得到页面宽度
var xScroll=(document.documentElement.scrollWidth>document.documentElement.clientWidth) ? document.documentElement.scrollWidth : document.documentElement.scrollWidth;
alert(xScroll)
</script>
【js 获取页面高度和宽度兼容 ie firefox chrome等】相关文章:
★ TypeError document.getElementById(...) is null错误原因
★ 简介JavaScript中toUpperCase()方法的使用
★ JavaScript中Math.SQRT2属性的使用详解
下一篇:
原生js的弹出层且其内的窗口居中