I'm trying to get the position of a table on a page..
<table id="tab">
by using :
var x = getAbsX(documen t.getElementByI d("tab"))
var y = getAbsX(documen t.getElementByI d("tab"))
which calls:
function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt," Left"); }
function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt," Top"); }
function getAbsPos(elt,w hich) {
iPos = 0;
while (elt != null) {
iPos += elt["offset" + which];
elt = elt.offsetParen t;
}
return iPos;
}
but the thing keeps giving me 0's for both x and y in IE but works in
Firefox. Can anyone help?
<table id="tab">
by using :
var x = getAbsX(documen t.getElementByI d("tab"))
var y = getAbsX(documen t.getElementByI d("tab"))
which calls:
function getAbsX(elt) { return (elt.x) ? elt.x : getAbsPos(elt," Left"); }
function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt," Top"); }
function getAbsPos(elt,w hich) {
iPos = 0;
while (elt != null) {
iPos += elt["offset" + which];
elt = elt.offsetParen t;
}
return iPos;
}
but the thing keeps giving me 0's for both x and y in IE but works in
Firefox. Can anyone help?
Comment