15 lines
497 B
JavaScript
15 lines
497 B
JavaScript
// xPageY, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
|
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
|
|
|
function xPageY(e)
|
|
{
|
|
if (!(e=xGetElementById(e))) return 0;
|
|
var y = 0;
|
|
while (e) {
|
|
if (xDef(e.offsetTop)) y += e.offsetTop;
|
|
e = xDef(e.offsetParent) ? e.offsetParent : null;
|
|
}
|
|
// if (xOp7Up) return y - document.body.offsetTop; // v3.14, temporary hack for opera bug 130324 (reported 1nov03)
|
|
return y;
|
|
}
|