日期:2014-05-17 浏览次数:20936 次
<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;
}
推荐阅读更多>
-
html 基准基础 小记
-
Cool Web Scrollbars - 定制网页的滚动条_HTML基础_前端技术
-
CSS中怎么实现图片垂直居中
-
HTML5实验:JavaScript模拟流体成效
-
怎么去掉如图所示的间隔
-
HTML5学习资源整理
-
html滚动条的批改
-
加载css模式
-
IE6中无法引用Css样式的有关问题
-
请教有没有一种配色软件 只要小弟我输入任何颜色值 它就能提示这是什么颜色呢
-
HTML标签参照网站
-
判断是不是是css文件
-
WHATWG发布HTML5规范草案
-
怎样让网页自动适应任意的浏览器窗口大小?该怎么处理
-
CSS3制造文字半透明倒影效果
-
请教
-
css-IE,firefox正中的区别
-
div+css成效
-
预备学习一下html5,css3,大家有什么好书,资料推荐一下
-
Jquery中dom对象取值的三种方式:val()、html()、text()