OnMouseOver
Sounds like some kind of secret code from a spy movie, doesn't it?Well... if you are here... you must want to learn how to do this cool effect! Well, you've come to the right place! Here are the menu buttons again, you can click them if you want:
Okay, well, your mouseovers don't have to be quite THAT boring. To see some other ones that I've done you can peek at my Athens site, or within the athens site is a fairly odd one at my Centaurs main page. My Christmas Page uses them quite a lot, and my commercial web page has a simple set. Even a page i'm working on for a friend uses them.
So, now that you've seen just some of the things that mouseovers can do, you probably want to make some for yourself, only more sophisticated.
The first thing with the onmouseovers, is that you have to have two pictures, one for when the mouse isn't over the button, and one for when it is over the button:
Okay, so now you have your images that you made in some paint program, or that someone gave you, or whatever, you are ready for the next step.
This step is a little more complex, because you have to take the code i'm going to give you, and you have to change it. For the effects I have above you can click here to see the stuff that has to go in the "head" portion of your html document. It is best to "cut and paste" the code from this page. The Sample code I use on this page is merely for sample purposes, and may give your browser a heart attack.
Okay, did you click the link? Have you seen the code? Good! Now I will demonstrate what to do with that code.
Okay, now you've cut and pasted the code from that text file into your html document. You've put it after the <Head> and before the </Head> tags, right? Good. Now you have to go in and change it around. Remember that you can only change those portions that are relevant. If you change anything else, it won't work. I speak from the experience of hours of frustration, so make sure that you only change the proper portions.
After the first script tag you see this:
<!-- function load_images() { var image1 = new Image(); aaon.src = 'a1.gif'; aaoff.src = 'a2.gif'; abon.src = 'b1.gif'; aboff.src = 'b2.gif'; acon.src = 'c1.gif'; acoff.src = 'c2.gif'; } //--> |
a1.gif | b1.gif | c1.gif |
a2.gif | b2.gif | c2.gif |
<!-- function load_images() { var image1 = new Image(); aaon.src = 'Ozzie.gif'; aaoff.src = 'Harriet.gif'; |
<!-- function load_images() { var image1 = new Image(); aaon.src = 'a1.gif'; aaoff.src = 'a2.gif'; abon.src = 'b1.gif'; aboff.src = 'b2.gif'; acon.src = 'c1.gif'; acoff.src = 'c2.gif'; adon.src = 'd1.gif'; adoff.src = 'd2.gif'; } //--> |