日期:2014-05-17 浏览次数:20898 次
<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; }
![]()
推荐阅读更多>
- form使用Get方式提交表单时是不是不能通过URL传递参数的?解决方案
- HTML字符实业,转义字符串-转
- 操纵历史,利用HTML5 History API兑现无刷新跳转
- IE与Chrome网页打印尺寸不一样,求教啊该如何解决
- CSS使DIV层绝对正当中【水平和垂直】
- 用freemarker生成html小例证
- (急)js打开新窗口返回值IE正常/firefox失败,该如何处理
- 怎样做设为首页和收藏夹…该如何处理
- 如何能用滤镜做出柱状图?请
- 关于图像在div里面显示 ie 和FF不同的有关问题
- IE与Firefox的CSS兼容有关问题整理 (转载)
- firefox加边框缩小错位有关问题
- 用css设立不确定宽度的div的高度等于本身宽度的2倍*
- HTML可输可选上拉框实现的JavaScript脚本-技术转载
- HTML5学习札记(一)-概述
- 2011 Google HTML5 体会
- 公司推举,打算弄个html来唱票,请帮帮忙
- 图片投射(HTML Map)自适应窗口大小,再也不用为匹配尺寸而发愁了
- 怎么使用Java提取html表单元素
- z-index为什么.box1 .inner不在.box2之上?解决办法