油个问题噢! scrollHeight,scrollWidth,scrollLeft,scrollTop分别对应:你的页面高度,宽度,距离左面的距离,距离右边的距离; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://blog.csdn.net/chinmo/archive/2008/02/18/2102799.aspx看看我的博客里的,还有图说明 自己顶一下为什么第2个页面<style type="text/css"><!--#haha{height:500px;width:600px;}--></style><script>function asd(){var a=document.getElementById("gg").scrollWidthvar b=document.getElementById("gg").scrollHeightvar c="距离左端的距离"+document.getElementById("gg").scrollLeftvar d="距离顶部的距离"+document.getElementById("gg").scrollTopvar str=a+"<br>"+b+"<br>"+c+"<br>"+d+"<br>外面div的高度:宽度"+document.body.scrollHeight+":"+document.body.scrollWidthdocument.getElementById("x").innerHTML=str}</script><body style="margin:0px;"><div id="haha"><div onscroll="asd()" id="gg" style="width:300px; height:200px;border:1px solid #FF0000;overflow:scroll"><div id="ss" style="width:400px; height:300px; border:1px solid #000000;"></div></div></div><div style="width:600px; height:350px;" id="x"></div>scrollWidth是1131为什么 会是1131?? 浏览器移动 获得div 大小 通过js 在线 急呀 求帮助 下面这段js语句无法实现Enter键实现Tab换行的功能,求解 急急,在线等 如何使鼠标指针悬停在超链接上时,指针变为某个特效flash效果? js问题 文本框值问题?在线等 急.. javascript复选框得的值怎么往文本框中传呢? HTML中显示的文字怎么自动换行(不是通过<br>来控制,而要其根据字体长度自动换行),请指教。 原创 WEB版图片搜索下载程序 求教一个简单数组循环求数值的问题,当文本框的值等与数组1的值得时候.... 怎样截获网页所有点击 myeclipse中有没有提供JavaScript拼写检查的插件?
为什么第2个页面
<style type="text/css">
<!--
#haha{
height:500px;
width:600px;
}
-->
</style>
<script>
function asd(){
var a=document.getElementById("gg").scrollWidth
var b=document.getElementById("gg").scrollHeight
var c="距离左端的距离"+document.getElementById("gg").scrollLeft
var d="距离顶部的距离"+document.getElementById("gg").scrollTop
var str=a+"<br>"+b+"<br>"+c+"<br>"+d+"<br>外面div的高度:宽度"+document.body.scrollHeight+":"+document.body.scrollWidth
document.getElementById("x").innerHTML=str
}
</script>
<body style="margin:0px;">
<div id="haha">
<div onscroll="asd()" id="gg" style="width:300px; height:200px;border:1px solid #FF0000;overflow:scroll">
<div id="ss" style="width:400px; height:300px; border:1px solid #000000;">
</div>
</div>
</div>
<div style="width:600px; height:350px;" id="x"></div>
scrollWidth是1131
为什么 会是1131??