ferret147 Posted November 14, 2013 Share Posted November 14, 2013 (edited) If you look at this code it gets the left coordinate of the div tag - http://jsfiddle.net/JuPA4/ which is pretty much what I need. I am using a program on the Mac called Hype, it is like flash but all HTML 5, my demonstration is here - http://snooker-magazine.co.uk/phpfreaks/black.html (I have asked on the Hype forums and have had no answer for 3 days now) The black dot element is within a div tag called #black for some reason the code posted above does not work with the hype file! I know I can interact with it and I have added a demonstration to the page click Hide / Show to interact with the dot. I am not the best with Javascript so if anybody has any ideas then the help would be appreciated. There is a zip file in the parent folder with all the files if anybody needs them. The end result of this is that the coordinates for both left and top are updated to a text input so I can place them into a database. Edited November 14, 2013 by ferret147 Quote Link to comment https://forums.phpfreaks.com/topic/283892-help-with-getting-coordinates-of-a-div-tag/ Share on other sites More sharing options...
dalecosp Posted November 14, 2013 Share Posted November 14, 2013 (edited) Your console error is: Uncaught TypeError: Cannot read property 'left' of undefined No JS guru here either, but I'm guessing we'd need to figure out why "position" is undefined at this point. Edited November 14, 2013 by dalecosp Quote Link to comment https://forums.phpfreaks.com/topic/283892-help-with-getting-coordinates-of-a-div-tag/#findComment-1458252 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.