日期:2014-05-17 浏览次数:21251 次
<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表格标志教程(5):亮边框色属性BORDERCOLORLIGHT
-
七个超级震撼的CSS3按钮组合
-
JS控制HTMLDOM表格行下上移动
-
请教个html格式的有关问题。望大侠解答!
-
怎么分别设置整个网页头部,中间,底部背景图片不一样
-
如何在软键盘0-9后面加上一个退格键呢
-
CSS中,对文字位置的疑义
-
求一段从注册表/文件中读URL,再访问该URL的网页代码(300分之200,请高人接分)解决方法
-
关于ie跟firefox鉴别html属性的区别
-
想用div实现三行,第一行在页面最上面,第三行在页面最下面,中间行自动滚动,该如何处理
-
webroot 覆盖,该如何解决
-
浏览器和dw中打开的网页不一样
-
网页显示图片时,若图片链接丢失,怎么用备用的图片显示
-
ie6 兼容性有关问题(再发)
-
网站部署-求指点!
-
分享十款最棒的免费HTML5视频播放器
-
ie6,ie7,ie8 css bug汇总以及兼容解决办法搜集
-
IE6 IE7下ol li无法显示list-style-type解决办法
-
HTML5学习因特网址记录
-
网页变形有关问题求教