HowardMarks
MIS
Hi guys
I have found a great script which gives me the x and y coordinates of an image on the page. This works fine if I run it from a button after the page has loaded.
The trouble is, I need to find out the position as the page loads, and use this information to accurately position some divs on top of it. Trouble is, when the page is loading, the script always returns '0,0' as the image position.
My knowledge of how javascript works is slightly below par i must admit, and I'm not sure in what order things get loaded etc. Am I chasing the end of the rainbow here by trying to find out the position of this image at the same time as it is drawn? Is there any way around this so I can place some text accurately over specific coordinates on top of this image?
any help would be great
thanks in advance
Nick (Webmaster)
info@npfx.com
I have found a great script which gives me the x and y coordinates of an image on the page. This works fine if I run it from a button after the page has loaded.
The trouble is, I need to find out the position as the page loads, and use this information to accurately position some divs on top of it. Trouble is, when the page is loading, the script always returns '0,0' as the image position.
My knowledge of how javascript works is slightly below par i must admit, and I'm not sure in what order things get loaded etc. Am I chasing the end of the rainbow here by trying to find out the position of this image at the same time as it is drawn? Is there any way around this so I can place some text accurately over specific coordinates on top of this image?
any help would be great
thanks in advance
Nick (Webmaster)
info@npfx.com