日期:2014-05-17 浏览次数:21418 次
<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;
}
推荐阅读更多>
-
b div在a div中,在b中使用margin-top 为什么a也受到影响?该怎么处理
-
请教怎么在一个网页实现不同的链接样式
-
HTML5 多媒体播放【一】
-
详解CSS的定位语法应用
-
HTML表格标志教程(22):行的亮边框色属性BORDERCOLORLIGHT
-
clear为何能实现自动高度
-
求问w3c html dom的api在哪里下载?每次写属性方法都乱试,很耗时间
-
position:fixed属性设立
-
惯用CSS书写技巧和CSS HACK技巧
-
CSS对div滚动条的式样设置
-
HTML JS 弹出窗口封锁大全
-
一个小站站长的心结~该如何处理
-
筹建属于你的在线实时采集系统——HTML5 在嵌入式系统中的应用
-
IE a:active bug(IE6/7/8/9) 非js解决方案交流,该怎么解决
-
网页内容的排布有关问题
-
掩藏显示左侧边栏,要兼容ie6、7,折腾人
-
如果浏览器内核为webkit 如何写只有他能用的css设置
-
怎么改变fieldset的边框颜色
-
怎么破解frameset
-
求一种报表的设计方法