| Home | JS 1 | JS 2 | A/S Online | St 1 | St 2 | Links | |
Animated buttons are quite easy to do. All you need is a image swap function. I named my function hlight. Essentially it swaps the original image with another. You can assign separate images to all the mouse events like onMouseOver, onMouseDown, onMouseUp and onMouseOut. Try moving your mouse to the image below and click on them. See what happens .... cool huh? |
You will need this images for this to work: Just copy the images below. I have made two sets for you.
|
Now for the Script. Like I have said I use the hlight function. The code is as follows: |
Then we preload the images. This is to ensure that the images are loaded first before the user uses the buttons.The code is as follows: |
Finally we place the button on to our page. It also need a bit of scripting. The code: |