日期:2014-05-17 浏览次数:21174 次
<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;
}
推荐阅读更多>
-
HTML5 APIs软件工程师指南
-
W3C教程(8):W3C XML Schema 活动
-
请教有没有画网页布局图的软件
-
网站性能优化- JS、CSS的合龙、压缩、缓存管理
-
HTML根本元素
-
施用jQuery和CSS3创建一个全屏幕幻灯效果
-
FF异常控制台报Image corrupt or truncated:http.的错
-
不同程序实现文字拖拽,该如何处理
-
XHTML+CSS的静态页面实现多风格选择的方法_HTML综合技巧_HtmlCss教程
-
Book05-No.一 XHTML与CSS基础
-
页面开发工具讨论,DW太不好用了.这个好多了.解决思路
-
div+css格局注意点
-
Marquee标志的另类用法
-
像素移动 IE 6解决思路
-
浏览器窗口大小变更时css的变化
-
用HTML5 Canvas写了个钟表
-
50求财付通首页上的箭头背景动画animate实现方法
-
问一个布局有关问题 table cell 的布局
-
怎么重用表示层里面已经设计好的框架,然后到逻辑层去填充数据
-
HTML5学习札记(三)-Video、Audio