SRL Archive - Web Development

Mouseover text to image


alexes

2012-02-08 08:52:17

Well I'm nub with html :/

I need to do a mouseover effect. There's a text and you pass mouse over this text an image has to appear, if it can be the text shouldn't disappear and the image should appear next to the text.

Something like this
<img src="image1.gif" onmouseover="this.src='image2.gif'" onmouseout="this.src='image1.gif'" alt="" title="" />

But with text and image not image and image.
Thanks for helping

Kyle Undefined

2012-02-08 09:33:29

Wait, so you want to have text that changes into an image on mouseover? Just make a CSS sprite and use that, much better and easier to use.

alexes

2012-02-08 14:55:25

From: Kyle Undefined
Wait, so you want to have text that changes into an image on mouseover? Just make a CSS sprite and use that, much better and easier to use.


ok thanx ill try ;)

Scaper

2012-02-08 16:21:47

javascript?

http://www.dynamicdrive.com/forums/showthread.php?t=7589
http://www.javascriptkit.com/script/script2/rolldifferent.shtml

Kyle Undefined

2012-02-08 16:40:04

Javascript isn't needed for this, much more resource heavy than a single CSS sprite :)

alexes

2012-02-09 02:31:23

Just did it with CSS thanks Kyle :)