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]; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.