日期:2014-05-17 浏览次数:20735 次
<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; }
推荐阅读更多>
- div 居中的有关问题
- HTML5下传
- frame self html中在iframe框架中有超链接,点击超链接后使整个页面本身跳转,而不是就跳框架内部跳转
- td上的onMouseOver=this.className='stylePageover'如何加上<DOCTYPE html>就不对了呢
- HTML相对路径(Relative Path)跟绝对路径(Absolute Path)
- FireFox下按钮灰化如何没有Tips提示了
- js缓存和静态html缓存机制不一样?解决方案
- 请教各位你们是如何清除项目中无效的css的
- CSS制作滚动图片有关问题
- 资料域去掉前面的文本域
- CSS3兑现的超酷页面过渡效果
- 网页中加载FLASH时为啥有一片白色的?
- ie上div中包含input输入框设置margin出现有关问题,不知道有人遇到吗,是不是ie的bug
- 《HTML XHTML CSS基础教程》读书笔记—01—XHTML,HTML的差别
- firefox里显示的图片下面都有几像素的空儿,请教怎么解决
- C#web解决办法
- 转载:护持HTML代码整洁的12条原则
- 几种网页元素居中方案小结
- html父窗口跟子窗口之间元素和js相互调用
- 一个兼容IE、Chrome跟Firfox的HTML固定表头例子