firefox怎么获取当前网页可视区域的高度啊 我用document.body.offsetHeight是IE可以得可视区域的高度。可是在FIREFOX下就不行,它好像得的是整个网页的高度了,, 在FIREFOX下如何获得呢。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function getDocumentBounds() { if (document.documentElement && document.compatMode == "CSS1Compat") { return { st: document.documentElement.scrollTop, sl: document.documentElement.scrollLeft, sw: document.documentElement.scrollWidth, sh: document.documentElement.scrollHeight, cw: document.documentElement.clientWidth, ch: document.documentElement.clientHeight } } else if (document.body) { return { st: document.body.scrollTop, sl: document.body.scrollLeft, sw: document.body.scrollWidth, sh: document.body.scrollHeight, cw: document.body.clientWidth, ch: document.body.clientHeight } }} <script>function getViewportHeight() { var height = 0; if (window.innerHeight) { height = window.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { height = document.documentElement.clientHeight; } else if (document.body && document.body.clientHeight) { height = document.body.clientHeight; } return height;}</script> ckeditor怎么插入图片?怎么把浏览服务器等不相关的选项卡隐藏 快捷键问题 ExtJs Combobox绑值问题 |zyciis| 如何在js文件里面创建一个img对像,但他的路径是对应当前js文件的呢?谢谢 一个简单的引号问题 javascript 找不到 动态生成控件 JS的一个小问题,简直是白给分 onkeydown="return false" 关于代替滚动条的问题??在线等待,谢谢! js接受到 Timestamp类型数据 将其设置到前台文本框 显示object object 下面这段JS看不懂,谁能帮忙看下 如何实现点击"×"关闭按钮后下次即使是刷新也不再显示
if (document.documentElement && document.compatMode == "CSS1Compat") {
return {
st: document.documentElement.scrollTop,
sl: document.documentElement.scrollLeft,
sw: document.documentElement.scrollWidth,
sh: document.documentElement.scrollHeight,
cw: document.documentElement.clientWidth,
ch: document.documentElement.clientHeight
}
} else if (document.body) {
return {
st: document.body.scrollTop,
sl: document.body.scrollLeft,
sw: document.body.scrollWidth,
sh: document.body.scrollHeight,
cw: document.body.clientWidth,
ch: document.body.clientHeight
}
}
}
function getViewportHeight() {
var height = 0;
if (window.innerHeight) {
height = window.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
height = document.documentElement.clientHeight;
} else if (document.body && document.body.clientHeight) {
height = document.body.clientHeight;
}
return height;}
</script>