Re: image change on mouse over

by Duane Hall <hallmark(at)intergate.bc.ca>

 Date:  Fri, 15 Oct 1999 17:21:03 -0700
 To:  hwg-basics(at)hwg.org
  todo: View Thread, Original
Hi Lois,

To do the mouseover that you want, place this code in the header area...

<script language="JavaScript">
<!--

if (document.images) {
  image1on = new Image();
  image1on.src = "http://www.ultranet.com/~icc/images/members/NBMMF2.JPEG";

  image1off = new Image();
  image1off.src = "http://www.ultranet.com/~icc/images/members/NBMMF.JPEG";

}

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src =
eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

// -->
</script>

And replace your image code in the body area with this one...

<a href="#" onMouseOver="changeImages('image1', 'image1on')"
onMouseOut="changeImages('image1', 'image1off')"><IMG name="image1"
<IRC="http://www.ultranet.com/~icc/images/members/NBMMF.JPEG" ALT="meeting
house" WIDTH="318" HEIGHT="232"></A>

You might also want to resize the NBMMF2.JPG to match the NBMMF.JPG. It
will make it load quicker.

HTH,
  Duane

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA