日期:2014-05-17 浏览次数:21272 次
<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;
}
推荐阅读更多>
-
document.getelementbyid("page").innerHTML红狐不兼容
-
Html中head中标签部的设立
-
几个经典的css技艺
-
chrome在应用text-shadow CSS 時有bug
-
JS+CSS兑现图片放大预览效果
-
怎么让html中的td自动换行,并在IE和firefox兼容
-
HTML资料导入eclise中文显示为乱码的解决方案
-
css hack的应用
-
WebGL施用
-
HTML5中的新事情
-
网页技巧学习:固定网页言语编码、字号、字体
-
html+css+js兑现xp window界面及有关功能
-
Why won't my HTML5 audio loop
-
怎么把PC版网页变成手机版
-
为何两个HTML代码一样,效果却不一样。求大神指导
-
HTML5 新增属性收拾
-
html5 video标签在iphone中的有关问题
-
HTML5基础教程:header元素的运用实例
-
css三角实现写法全攻略收集
-
Phonegap:高速开发跨平台HTML5应用的胶水层