[thelist] onClick event code

sfmalo sfmalo at msn.com
Mon May 7 10:02:34 CDT 2001


About a week ago PPK kindly suggested going to a link for JS Rollover code.
I did, printed out the pages, and puzzled over them for a l-o-n-g time.
Because I'm so new to this, I just couldn't make the grade so I found
something I understand a little better at this point for onMouseOver and
onMouseOut events.

I then included an array for the onClick event, but couldn't figure out the
syntax and correct positioning for adding it to the Function code (see
below).
Could someone suggest what (and exactly where) I add the right words to
include this event?
Also, where would I add the Netscape 6 bug fix that goes: var loaded =
(!(navigator.userAgent.indexOf('Netscape6')+1)); ??
I've commented out the entire code which I hope works so this doesn't bomb
someone's email!

<!--<script language="JavaScript"  type="text/javascript" >
<!--

if (document.images) {
  image1on = new Image();
  image1on.src = "images/nav_adult1b.gif";

  image2on = new Image();
  image2on.src = "images/nav_burn1b.gif";

  image3on = new Image();
  image3on.src = "images/nav_camp1b.gif";

  image1off = new Image();
  image1off.src = "images/nav_adult1a.gif";

  image2off = new Image();
  image2off.src = "images/nav_burn1a.gif";

  image3off = new Image();
  image3off.src = "images/nav_camp1a.gif";

image1clik = new Image(),
image1clik.src = "images/nav_adult1c.gif";

image2clik = new Image(),
image2clik.src = "images/nav_burn1c.gif";

image3clik = new Image(),
image3clik.src = "images/nav_camp1c.gif"
 }
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>
<noscript>Viewers with Javascript disabled will still be able to navigate
the menu items by clicking on the graphical text link.</noscript>
</head>
<body onLoad="loaded = true">
<table width="100%" border=0 cellpadding=0 cellspacing=0>
<tr><td width=130><a href="../html/NFadultret.html"
onMouseOver="changeImages('image1', 'image1on')"
onMouseOut="changeImages('image1', 'image1off')"
onClick="changeImages('image1','image1clik');"><img name="image1"
src="images/nav_adult1a.gif" alt="adult retreats" width=130 height=36
border=0></a></td></tr>
<tr><td width=130><a href="../html/BurnTreatment.html"
onMouseOver="changeImages('image2', 'image2on')"
onMouseOut="changeImages('image2', 'image2off')"
onClick="changeImages('image2','image2clik');"><img name="image2"
src="images/nav_burn1a.gif" alt="burn treatment" width=130 height=36
border=0></a></td></tr>
<tr><td width=130><a href="../html/NFcampkids.html"
onMouseOver="changeImages('image3', 'image3on')"
onMouseOut="changeImages('image3', 'image3off')"
onClick="changeImages('image3','image3clik');"><img name="image3"
src="images/nav_camp1a.gif" alt="camp for kids" width=130 height=36
border=0></a></td></tr>
</table>-->

Thanks, Sharon
---------------------------------------------------------------------------
Sharon F. Malone
"web design and Internet writing services"
http://www.24caratdesign.com





More information about the thelist mailing list