日期:2014-05-17 浏览次数:21051 次
<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;
}
推荐阅读更多>
-
为什么小弟我的SIZE属性不是INPUT标签的合法属性。
-
CSS的行内式样书写规范
-
7款设计巧妙的CSS3飘条形菜单和窗口
-
玩转HTML5运用实战:灵活拖拉文件
-
批改MyEclipse开发工具中的页面模板(JSP和HTML)
-
CSS hack:针对IE6,IE7,firefox展示不同效果
-
几个经典的css技艺
-
CSS课程4 CSS的Text 文本
-
onclick事件为何在IE下没反应,在FIREFOX却可以呢
-
HTML DOM select() 步骤
-
以HTML网页实例说明head区代码的意思
-
网页优化的最基础局部:HTML的优化
-
免费的精制品: Productivity Power Tools 动画演示
-
网页设计中的默许字体样式详解
-
html5 本土存储和会话存储
-
活用CSS巧妙解决超长文本内容显示有关问题
-
关于网页大图的加载解决方案
-
html js解决方案
-
【转】JAVA:借用OpenOffice将下传的Word文档转换成Html格式
-
HTML: button跟input button的区别