日期:2014-05-17 浏览次数:21271 次
<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头部
-
css正中
-
浮动元素的文字缠绕想不明白
-
用jQuery切换CSS样式表改变作派(无刷新)
-
动态生成table添CSS+js
-
将前台HTML页面转义替普通的html文本
-
用正则表达式取<TD>中的内容,该如何解决
-
带背景的option 设置了selected 后背景不显示解决方法
-
html5新特性- <a>标签新属性download
-
ext htmleditor 没法输入
-
CSS语法手册(五)颜色和背景属性
-
要做一个手机访问的页面,如何做才可以适合手机屏幕大小
-
应用HTML5和Google Maps构建手机LBS游戏
-
关于url传参数有关问题,困扰小弟我很久了,求解~
-
在HTML5下绘制图片,图片加载有关问题
-
关于css 控制table的有关问题,遇到个有关问题
-
CSS背景色彩渐变
-
怎么实现网页中窗体浮现功能
-
html温习3:meta
-
霸占第二贴,该怎么处理