Forum Moderators: open

Message Too Old, No Replies

image popup

wondering how to do this...

         

ofjurai

8:46 pm on Feb 16, 2004 (gmt 0)

10+ Year Member



I have been trying to figure out how to do the image popup when you onmouseover the thumbnails that is located on this site: [discountanimedvd.com...]
^(is just a sample page, if there is another way to do it either is fine, that page is just what I'm trying to do)
It's not a normal window popup, I've never seen it before and thought it was pretty cool.
I'm new to java and everything so I really don't know what to do to convert it to work for me.
If someone could show me how to do this that would be great.

RonPK

10:16 pm on Feb 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, welcome to WebmasterWorld! Posting URLs with examples is against this site's TOS [webmasterworld.com], AFAIK, so there is a chance that a moderator will remove it.

Anyway, I had a look and saw it was pretty simple. As you already pointed out, it's not an ordinary popup: it doesn't open a new window. Notice the empty DIV at the beginning of the <body>:
<div id="message" style="Z-INDEX: 1; LEFT: 8px; POSITION: absolute; TOP: 20px; "></div>
(I removed some layout stuff.)
This is the layer in which the images are shown onmouseover.

Every thumbnail (not really thumbnails here, just shrunken images) is embedded inside a hyperlink with some event handlers:
<a onMouseMove="msgposit()" onMouseOver="msgset('/images/123.jpg')" onMouseOut="msghide()" href="somefile.asp"><img src="/images/123.jpg" width="60" height="85" border="0"></a>

The script functions are IE only, so I won't discuss them in detail here. (This forum is about the World Wide Web, not Bill's Backyard).
msgposit() get's the position of the mouse pointer and uses that as an offset to position the message DIV.
msgset(img) modifies the innerHTML property of the message DIV. It inserts the image into the message DIV, so to say.
msghide() hides the message DIV whenever the mouse pointer no longer hovers over the thumbnail. It simply sets the innerHTML property to empty.

I hope this helps you.

ofjurai

8:16 am on Feb 19, 2004 (gmt 0)

10+ Year Member



oops sorry about posting the link

well since I had no clue on how to do it I couldn't think of another way to show an example.

Anyway, I'm even more confused now because I didn't know about that DIV layer.

RonPK

9:01 am on Feb 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, why not copy the page and modify it step by step to suit your needs. Whenever something breaks, undo the last modification.

ofjurai

4:29 pm on Feb 19, 2004 (gmt 0)

10+ Year Member



Well since I know about that DIV layer now I will go back and try that again.

I originaly tried doing that but I couldn't get it to work. Thats why I posted here because I tired everything I knew first and still couldn't get it.

I'm just starting out with all this html stuff so thanks for the help.