我用了prototype.js (版本1.4)
alert(Position.realOffset(obj))[1])其中这句代码是在下面的iframe中使用,obj也是下面iframe中的元素,但显示的结果却比实际大很多的,如我只滚动一点点, 大概50-60个像素, 它却显示有100多, 
var tDragIframe = document.createElement("iframe");
tDragIframe.id = "DragIframe";
tDragIframe.style.width = '100%';
tDragIframe.style.height ='100%';
document.body.appendChild(tDragIframe);
var oDragIframe = $('DragIframe').contentWindow;
oDragIframe.document.open();
oDragIframe.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml><head>');
oDragIframe.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
oDragIframe.document.writeln('</head><body>');
oDragIframe.document.write(oBodyDiv[0].innerHTML);
oDragIframe.document.writeln('</body></html>');
oDragIframe.document.close();