日期:2014-05-17 浏览次数:20947 次
<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;
}
推荐阅读更多>
-
为什么IE和FF对CSS float属性的理解很不一样?解决方法
-
innerHTML跟value区别
-
图片和文字不在同一高度如何搞
-
HTML中图片暖区的使用
-
布局不兼容IE的有关问题-宽度不够
-
js画图开发库-mxgraph-[fileio-资料读取.html]
-
晕了 在公司测试IE6兼容无有关问题,回到家就出BUG了
-
不是很懂 特来请问 a:link
-
取css中的图片有关问题
-
HTML 五 参考手册
-
小弟我的css有有关问题,但是浏览器显示没有异常,到别人机子才知道哪错了,那样小弟我的机子就起不到测试的作用了,各位大侠知道咋回事吗
-
DIV+CSS布局有关问题
-
页面底端有一块空白区域,该怎么处理
-
怎么让网页自适应分辨率
-
ie6的下边框本来设置为none,可是还是显示出来一条线是咋回事
-
让div+css的div正当中, 而里面的文字不居中的做法
-
如何用做Flash制作时钟
-
Five Things You Should Know About HTML5(HTML5,您需要知道的5件事)
-
一个关于framset的有关问题
-
自定义 HTML5 Progress 的式样