Re: JAVASCRIPT_ROLLOVER

by =?iso-8859-1?Q?St=E9phane?= Bergeron <stephberg(at)videotron.ca>

 Date:  Mon, 17 Jan 2000 22:32:07 -0500
 To:  hwg-techniques(at)hwg.org
 References: 
  todo: View Thread, Original
At 06:40 PM 17/01/00 -0800, you wrote:
>Can anyone figure out why this javascript
>rollover using functions doesn't work?
>http://www.fatgraffix.com/javabug/map.html

Your problem is that you do not refer to the image correctly in your=20
functions.  You have:

function img_act(imgName) {
         document [imgName].src =3D eval(imgName + "on.src");
}

should be:

function img_act(imgName) {
         document.images[imgName].src =3D eval(imgName + "on.src");
}

I also suggest you check for browsers that cannot do rollovers (IE 3.0x and=
=20
NS 2.0x) with the following:

function img_act(imgName) {

         if (document.images) {
                 document.images[imgName].src =3D eval(imgName + "on.src");
         }
}

HTH!

St=E9phane Bergeron

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA