日期:2014-05-17 浏览次数:20750 次
<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; }
推荐阅读更多>
- 分享2011年十月的各大桌面和手机移动浏览器对HTML5,CSS3和SVG的兼容性支持对比网站caniuse.com
- 请教怎么实现 鼠标移动 图片上时 图片颜色变暗,并在图上出现文字说明
- 初学者关于网页图片显示的有关问题
- window.showModalDialog firefox上的显示有关问题
- jquery 在 ie6 上 datagrid appendRow 不兼容
- HTML教程:marquee标签完成滚动效果
- Web开发者应当末尾学习HTML5的新功用
- css半透明成效
- 制造一个网站
- 分享自各儿做的一个HTML5扫雷游戏
- html5的非一般标签作用-20140114
- CSS的50个代码片断
- XHTML+CSS建站如何调用样式表
- 为什么要使用UL和LI?解决思路
- css3一款3D字体带影子效果
- 关于dreamweaver框架中的页面大小设置有关问题
- CSS中怎么实现图片垂直居中
- css中一个div可以与此同时设置左浮动和相对定位
- 页面之间怎么传递参数
- 火狐文本框文字如何不居中