rollover help

biferi

Daemon Poster
Messages
690
I am going to make a rollover image with JavaScript but then I saw on the net you can do it with CSS.

It loads all the images at one time and then goes through them wen the mouse is over it.

Thy say make all your images in one a Sprite.

But what is this and is it easyer and is there onother way??
 
Oh. My. God.

How many times have you asked questions like this!?! Just use Javascript, there is no difference! A guy gave you perfectly fine code to use!
 
I agree my code is perfectly good to use. However if you wish to use CSS, here you go:

Place this between <head></head> tags:
Code:
<style type="text/css">
#img {
background-image:url('PATH/TO/IMAGE1.gif);
}
#img:hover {
background-image:url('PATH/TO/IMAGE2.gif);
}
</style>

Place this within the <body></body> tags where you want the image to be:
Code:
<div id="img"></div>

There you go, just please stop double posting threads. This question could have been asked within the same thread.
 
Back
Top Bottom