日期:2014-05-17 浏览次数:21116 次
<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;
}
推荐阅读更多>
-
div中top和height使用百分比无效的有关问题
-
birt的CSS式样应用
-
怎么在HTML中引用jQuery函数库
-
CSS完善兼容IE6/IE7/FF的通用方法<三>
-
容易美观的CSS3登录表单
-
HTML5可以做一个tcp socket的server吗?解决办法
-
文件下载->另存为 时,指定默认文件名指定为小弟我自己设的文件名
-
一个简单的行为不知道如何应用
-
web绘图技术,有心得的来
-
css-float-浮动,高度有关问题,clear,overflow
-
html5 canvas做手记签名
-
css如何把背景图片拉伸至100%
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-
FCKeditor在html中的使用
-
如何去除正则表达式匹配到的所有匹配项
-
15个您必须知道的CSS常识
-
W3C教程(2):W3C 顺序
-
jsoup官方解析跟遍历一个HTML文档
-
HTML5实例教程:页面导航nav标签
-
html设立标题图标