adam84 Posted September 13, 2007 Share Posted September 13, 2007 does anyone know a JS method that will return either the X or Y coords on a certain object??? I want to get the Y coord. Thanks Quote Link to comment Share on other sites More sharing options...
mainewoods Posted September 17, 2007 Share Posted September 17, 2007 from quirksmode.com: 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.