Wednesday, September 2

Buttons Change on Hover

First time I've done this (I think). Short sweet code.

<a href="link"><img src="images/button.jpg"
onmouseover="this.src='images/buttonhover.jpg';"
onmouseout="this.src='images/button.jpg';" /></a>
It would not surprise me if there were instances where this fails. But it's also pretty nice because you don't have to worry about a no js version; it just doesn't do anything without js.

If you're using large images, you might want to preload them.

No comments: