capt webb
Capt. Horatio T.P. Webb
VBScript MouseOvers
Parks -- FALL 1999

Last Updated 10:00 AM 4/16/2018

 
First the two images for the rollover. Here are the two button images:
 
buttonup.gif 32 pixels wide and 20 pixels tall
buttondwn.gif 32 pixels wide and 20 pixels tall
 
Now the "live" rollover image:
 
 
Don't like red or green, just edit the red and green colors in the two images to alter the button appearance. Note -- on a white background, the white bevels (upper and left side) of the buttonup.gif image are not contrasted well against the white background.

Here is the javascript code:

function swp(mouse_action) 
  {
  switch(mouse_action)
    {
     case "down":
        document.images[3].src="buttondwn.gif";
        break;
     case "up":
        document.images[3].src="buttonup.gif";
        break;
     case "click":
        alert ("You clicked the button!");
        break;
    }  
  }

and the code in the HTML for the "live" button:

<a href="#" onMouseOver="swp('down')" onMouseOut="swp('up')" onClick="swp('click')">
<img src="buttonup.gif" border="0"></a>