日期:2014-05-17 浏览次数:21369 次
<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;
}
推荐阅读更多>
-
CSS学习总结
-
怎么用jQuery和CSS3制作数字时钟[译]
-
想把一个DIV放到一个大DIV的右上角该怎么处理?该大DIV包含两个并列的DIV
-
div块位置受浏览器尺度变化,求高人
-
求CSS控制链接样式的代码,要求如下:解决思路
-
页面布局解决方案
-
IE和Firefox浏览器上js css的兼容性分析
-
DIV滚动条如何替换成浏览器默认滚动条
-
jquery 扩张 escapeHtml
-
求教一款图片批量下传工具!
-
求教一个简单的table布局有关问题
-
在HTML中给Flash添加链接 屏蔽Flash右键
-
各浏览器,再有没有类似firebug的武器
-
HTML5相干资源-phoneGap
-
如何能用滤镜做出柱状图?请
-
HTML标签详解
-
HTML5 Input 门类
-
浅谈在网页上显示日期的两种方法
-
CSS标签跟属性
-
依据IE版本不同调用不同CSS样式文件