Log in

View Full Version : Need code



quadc281
02-15-2008, 07:28 PM
Several years ago I found a code that used 2 images. It was what I guess would possibly be called mouse over effect. There is 1 image showing and when you put the mouse over that image it changed to another image. similar to a button that when the mouse is over it, it changed to look like it was depressed. I used this code for links in a specific section of my site. Does anyone know what this code is called or where I can find it, as I lost my copy of the code and would like to use it again. Hope someone understands what I'm talking about.


Thanks for any help

jscheuer1
02-15-2008, 07:40 PM
There are many such scripts available around the web. They are generally known as rollovers. The DD version is:

http://www.dynamicdrive.com/dynamicindex15/domroll.htm

Without using any formal script, a single rollover could be done like so:


<img src="off.gif"
onmouseover="this.src='on.gif';"
onmouseout="this.src='off.gif';><img
style="position:absolute;visibiity:hidden;"
src="on.gif">

The second image tag takes up no space and is invisible. It is only there to 'preload' the rollover image. There are other methods of preloading.

BLiZZaRD
02-16-2008, 12:10 AM
Many types and many ways. If you don't want to use JavaScript there are pure CSS ways to do it as well.

I have outlined a couple ways of doing it on a test site of mine.

You can see the tutorials here (http://outsidetheurl.com/FCL/Codes/)