View Full Version : need rollover effect w/o link

07-09-2003, 02:11 AM
Is there a way or workaround for this? I want to use mouseover effects but without the clickable link involved, so the image changes but clicking has no (detectable) effect, and preferable where clicking does not put a fine dotted marquee around the image, perhaps even without the cursor turning to a pointing hand. I thought of having the link open an invisible div layer or something, but I am very new to javascript and haven't had time to play with that yet. I just want an interactive visual effect on the page.

07-09-2003, 02:22 AM
Here's what I think you're looking for:


07-09-2003, 11:17 AM
the wickford example is not exactly what ericjt is looking for. Furthermore, it works for IE only.

I think you can obtain that kind of effect when onclick if you include the event inside a "neutral" dividing tag, such as DIV, whith the image inside, instead of includung that event in <a href> tag (the latter will always make visible that fine dotted marquee you mentioned.

try something like:
<div onclick="somefunction()">
<img src="image.gif">

07-09-2003, 01:00 PM
quite simply:
<img src="before.gif" onmouseover="this.src='after.gif'" onmouseout="this.src='before.gif'">
And it helps to have the image preloaded

07-09-2003, 02:20 PM
Good one ahosang. I should have thought of that.