Forum Moderators: open

Message Too Old, No Replies

Get absolute positon of an image

         

Perfect Member Name

8:31 pm on Feb 6, 2004 (gmt 0)

10+ Year Member



Here's the user interaction that I'm going for:

There is an image on a page that says "click me for options". When clicked, I want a div to be revealed, just below the image.

Here's the trick - the image will be in different places on different pages, so I need to set the position of the div to be relative to the position of the image.

How can I obtain the absolute position of the image so that I can absolutly position the div?

Thanks.

isitreal

8:32 pm on Feb 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Put both img and comment div inside of another div, then position the container div wherever you want it, and just have the comment div appear on mouseover or whatever effect it is you are looking for, assuming the images are more or less the same width that should work fine

<div id="container">
<img>
<div id="comment">comments</div>
</div>