日期:2014-05-17 浏览次数:20884 次
<script> var d, str; window.onload = window.onscroll = function () { d = document.getElementById("d"); str = "<strong>" + ((document.compatMode.toLowerCase().indexOf("back") >= 0) ? "Quirks" : "Standards") + "</strong><br />" + "document.documentElement.scrollTop:" + document.documentElement.scrollTop + "<br />" + "document.body.scrollTop:" + document.body.scrollTop; d.innerHTML = str; } </script> <body style="font:12px Arial; _background-attachment:fixed; _background-image:url(about:blank);"> <div style="height:10000px;"></div> <div id="d" style="position:fixed; top:0; left:0; _position:absolute; _top:expression(offsetParent.scrollTop); _left:expression(offsetParent.scrollLeft); background:#ddd;"></div> </body>
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
int HTMLBodyElement::scrollTop() const { // Update the document's layout. Document* doc = document(); doc->updateLayoutIgnorePendingStylesheets(); FrameView* view = doc->view(); return view ? adjustForZoom(view->scrollY(), view) : 0; } int HTMLBodyElement::scrollLeft() const { // Update the document's layout. Document* doc = document(); doc->updateLayoutIgnorePendingStylesheets(); FrameView* view = doc->view(); return view ? adjustForZoom(view->scrollX(), view) : 0; }
![]()
推荐阅读更多>
- CSS+DIV的根本总结(二、回顾)
- padding跟margin的区别
- 怎的设置这个图片的位置
- ,不知道大家有没有碰到过这样的有关问题
- 帮小弟我看看里面有什么有关问题吗?多谢
- Follow your heart (135)-html=how to make luv
- html 字符实业
- 表格跨列时单元格的边框线有关问题
- 相仿qq空间的无限回复功能实现
- HTML标签抵补器
- 采用html 的a标签,href连接为文件时无法上载解决方案
- 分享40个超棒的CSS3旋钮教程
- js与DOM初始:访问html元素
- js获取html元素宽度的思忖
- css式样名规范命名建议
- 很奇怪的现象,帮忙看上
- IE打不开网页,弹出下载网页文档对话框!怎么解决
- 父DIV的高度不能根据子DIV自动变化的解决方案
- 请教这种CSS如何修改呢
- 微软这样的菜单是怎么制作的