eddy556 Posted April 23, 2009 Share Posted April 23, 2009 I have a problem with the offsetLeft function in Firefox, it gives out different numbers than in IE. After a bit of research I have found out that this is very well known however I have yet to find a proper solution. This is my code (works in IE), is there any way this could be converted to work in both? function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft; curtop = obj.offsetTop; while (obj = obj.offsetParent) { curleft += obj.offsetLeft; curtop += obj.offsetTop; } } return [curleft,curtop]; } Link to comment https://forums.phpfreaks.com/topic/155333-offsetleft-firefox-problems/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.