scrollTop、scrollLeft、scrollWidth、scrollHeight http://www.cftea.com/c/2006/12/WOYNSH75QM4NPFRS.asp
来源:互联网 发布:域名注册需要实名吗 编辑:程序博客网 时间:2024/05/09 20:00
scrollTop 是“卷”起来的高度值,示例:
<div style="width:100px;height:100px;background-color:#FF0000;overflow:hidden;" id="p">
<div style="width:50px;height:300px;background-color:#0000FF;" id="t">如果为 p 设置了 scrollTop,这些内容可能不会完全显示。</div>
</div>
<script type="text/javascript">
var p = document.getElementById("p");
p.scrollTop = 10;
</script>
由于为外层元素 p 设置了 scrollTop,所以内层元素会向上卷。
scrollLeft 也是类似道理。
我们已经知道 offsetHeight 是自身元素的宽度。
而 scrollHeight 是内部元素的绝对宽度,包含内部元素的隐藏的部分。
上述中 p 的 scrollHeight 为 300,而 p 的 offsetHeight 为 100。
scrollWidth 也是类似道理。
IE 和 FireFox 全面支持,而 Netscape 和 Opera 不支持 scrollTop、scrollLeft(document.body 除外)。
- scrollTop、scrollLeft、scrollWidth、scrollHeight http://www.cftea.com/c/2006/12/WOYNSH75QM4NPFRS.asp
- scrollTop、scrollLeft、scrollWidth、scrollHeight
- scrollTop、scrollLeft、scrollWidth、scrollHeight
- scrollHeight,scrollLeft,scrollTop,scrollWidth
- scrollTop、scrollLeft、scrollWidth、scrollHeight
- clientHeight、offsetHeight和scrollHeight http://www.cftea.com/c/751.asp
- offsetTop、offsetLeft、offsetWidth、offsetHeight http://www.cftea.com/c/2006/12/PCTKER6T0V62S854.asp
- offsetTop.offsetLeft,offsetWidth,offsetHeight,offsetParent,scrollTop,scrollLeft,scrollWidth,scrollHeight区别
- 兼容各浏览器的clientWidth,clientHeight,scrollWidth,scrollHeight,scrollLeft,scrollTop
- 转:js中scrollHeight,scrollWidth,scrollLeft,scrolltop等差别介绍
- offsetLeft,offsetTop,offsetHeight,offsetWidth,scrollTop,scrollLeft,scrollHeight,scrollWidth
- 千一网络http://www.cftea.com/
- scrollHeight,scrollLeft,scrollTop,scrollWidth,offsetHeight,offsetLeft,offsetTop,event.clientX,event.clientY
- 网页里的各种高度和宽度(3)scrollTop、scrollLeft、scrollWidth、scrollHeight
- JS 中关于document和window对象的一些值: scrollHeight,scrollLeft,scrollTop,scrollWidth等。。
- http://www.c-sharpcorner.com/Internet.asp
- offsetWidth clientWidth scrollWidth scrollTop scrollLeft等属性的细微区别
- SCrollTOP scrollHeight
- vc如何让打开的子窗口默认是最大化的
- clientHeight、offsetHeight和scrollHeight http://www.cftea.com/c/751.asp
- 一步一步学写makefile (一)
- offsetTop、offsetLeft、offsetWidth、offsetHeight http://www.cftea.com/c/2006/12/PCTKER6T0V62S854.asp
- 怎样配置Redhat Linux的IP和网关啊?
- scrollTop、scrollLeft、scrollWidth、scrollHeight http://www.cftea.com/c/2006/12/WOYNSH75QM4NPFRS.asp
- XML 留言本
- 比尔盖茨的十大经典人生定律
- 使您的軟體執行起來: 防止緩衝區溢位
- C++引用与指针的比较
- ASP.NE 中读取XML文件信息的4种方法
- 也谈SQLGrammarException
- 网站设计常用技巧
- top、clientTop、scrollTop、offsetTop http://www.zaoxue.com/Article/readcourse/bianchengwendang/HTMLCSS/2005112516341639.shtml