日期:2014-05-17 浏览次数:21048 次
<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;
}
推荐阅读更多>
-
IE6下面父div:padding,子div:float有关问题
-
TABLE怎么让某行无边框
-
div position:absolute 里面嵌套的 div float:left 可以向左侧撑出么,该怎么解决
-
Yii Framework在控制器增添CSS文件或JavaScript文件
-
关于js控制div中内容赋值进text中的有关问题,如何字会往上对齐的?
-
HTML页面中的table分页显示
-
html 动态添加下传文件控件
-
HTML5 预加载效能
-
6个不常用HTML标志
-
HTML表格标志教程(48):CSS修饰表格
-
在HTML对象上使用多个class Name
-
登记时,获取不到struts标签中的gender值
-
与HTML相比XHTML有什么特点?
-
safari下div不能相应鼠标事件的有关问题
-
js兑现的一个CSS过滤器
-
十个让人眼花缭乱的 HTML5 和 JavaScript 效果
-
请教怎么实现这个效果
-
【求教】在Safari浏览器中怎么去掉iframe的滚动条
-
关于侧边栏隐藏的有关问题
-
怎么应用ul、li标签 创建css横向导航菜单