[thelist] onClick event code

Mark Groen markgroen at telus.net
Mon May 7 10:18:24 CDT 2001

There is a very good explanation of how to implement that style of mouse
over at this link from CNET: Even includes a generator that creates the code
for you and it works in NN or IE.


----- Original Message -----
From: sfmalo
To: thelist at lists.evolt.org
Sent: May 07, 2001 8:01 AM
Subject: [thelist] onClick event code

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
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");

// -->
<noscript>Viewers with Javascript disabled will still be able to navigate
the menu items by clicking on the graphical text link.</noscript>
<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
<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
<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

Thanks, Sharon
Sharon F. Malone
"web design and Internet writing services"

For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !

More information about the thelist mailing list