日期:2014-05-17 浏览次数:21249 次
<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布局解决方案
-
求各位大神帮小弟我搞一个介绍云南的html静态页面
-
用仿ActionScript的语法回编写html5——第三篇,鼠标事件与游戏人物移动
-
ip地址转换,该如何解决
-
简略兼容浏览器(CSS hack)
-
留言到邮箱解决方法
-
把一个网页“另存为”后,CSS代码里的图片并没有保存,有什么办法都保存下来?该怎么处理
-
你知道吗?——表格的盒子模型有关问题
-
innerHTML在IE停的特殊:不支持table作为容器
-
html页面显示的有关问题
-
理解CSS的查找匹配原理,让CSS更简洁、高效
-
ie6上,li里放中文跟英文,高度显示不一样,导致排版错位
-
select标签中的option,怎么设置它的宽度
-
【转】 dhtmlxTree 十分钟做一个树
-
请大家帮忙估个价解决方案
-
常见浏览器兼容性有关问题与解决方案css篇
-
CSS禅意花园——CSS设计的绝美意境
-
css 高手帮小弟我看下,这段代码如何浏览器跟div一直有间距
-
html做成的chm无法打开
-
Emmet根本语法学习及HTML缩写加速