Forum Moderators: open
This function gets the X & Y of the any element which is in my case a DIV and it works fine cross browsers!
The problem is that it doesnt work in FF & Safari when the DIV is populated by AJAX.. i don't know it doesnt see the new DIVs or what is it.. but the obj is passed to it correctly for sure and it works gr8 in IE6 & 7
How to tweak it to see the new DIVs created by AJAX?
function findPos(img,obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
alert(curtop);
}
Thanks in advance