Heard about some neat code that'll let you do image rollovers without writing a line of Javascript (or VBScript, for that matter). Basically, it sets one image as a background and uses CSS's ":hover" property to show or hide an image in front of it. Works equally well in IE or Firefox.
See it in action
Here's the code:
index.htm Code:
<html>
<head>
<link rel="stylesheet" type="text/css" href="rollover.css">
</head>
<body>
<a href="#top" id="funky" class="rollover"><img src="funky.gif"></a>
<a href="#top" id="fresh" class="rollover"><img src="fresh.gif"></a>
</body>
</html>
rollover.css Code:
.rollover { display: block; }
.rollover img { width: 100%; height: 100%; border: 0; }
.rollover:hover { visibility: visible; }
.rollover:hover img { visibility: hidden; }
#funky {
background-image: url(funky_selected.gif);
width: 100px;
height: 50px;
}
#fresh {
background-image: url(fresh_selected.gif);
width: 100px;
height: 50px;
}
For the sake of space, I stripped out the comments, though they're available in the example files I used. Thanks to redmelon.net for the idea & code!