Effect with the graphic button.

Given JavaScript you can use in the page for effect of replacement images. Except for events "onMouseOver" and "onMouseOut" it is possible to apply and others. The code on compatibility popular Brousers is here too inserted.

Example JavaScript for giving effect of the pressed button

For demonstration of work move the index of the mouse on the button.
<HEAD>
<SCRIPT LANGUAGE = "JavaScript">
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
  if ((bName == "Netscape" && bVer >= 3) ||
    (bName == "Microsoft Internet Explorer" && bVer >= 4)) version = "n3";
  else version = "n2";
  if (version== "n3")
{
  image00off = new Image(1, 2);
  image00off.src = "kn1.gif";

  image01off = new Image(1, 2);
  image01off.src = "image 1";
    ...
    ...

  image00on = new Image(1, 2);
  image00on.src = "kn2.gif";

  image01on = new Image(1, 2);
  image01on.src = "image 2";
    ...
    ...

}
function img_on(imgName)
{
     if (version == "n3")
{
imgOn = eval(imgName + "on.src");
document.images[imgName].src = imgOn;
}
}

function img_off(imgName) {
if (version == "n3") {
imgOff = eval(imgName + "off.src");
document.images[imgName].src = imgOff;
}
}
</SCRIPT>
</HEAD>

The second part. Allocated Red, Namely names of files картинок, write depending on quantity - image00, image01 ... imagenn. (Attention: nn - there should be 2 symbols.)

<body>
<A HREF="URLname"onMouseOver="img_on('image00')" onMouseOut="img_off('image00')" >
<IMG NAME="image00" SRC="URLimage1" border=0 ></A>

<A HREF="URLname"onMouseOver="img_on('image01')" onMouseOut="img_off('image01')" >
<IMG NAME="image01" SRC="URLimage2" border=0 ></A>

. . .
. . .
Copy the text with this странички, use and take pleasure!

BACK