[thelist] Javascript - image swap not working on NS 4.75 Mac

Tara Cleveland tara at taracleveland.com
Thu Nov 28 16:09:00 CST 2002

Hi all,

I'm tearing my hair out. I've got an image swap thingy that isn't working on
NS 4.75 for Mac, but seems to work fine everywhere else.

It's supposed to replace the main image with a different image when you
click on a thumbnail. I don't know if I'm overlooking something totally
basic, or what. If one of you JavaScript gurus could look it over and tell
me what I'm doing wrong that would be great.

Thanks in advance,

Here's a stripped down version of the page:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html lang="en">
<script language="JavaScript">

    function thePreload()

   var imgs = new Array('mainimage1.jpg',

function preloadImages(imgsarray) {

   for(var loop = 0; loop < imgsarray.length; loop++)

     var animage = new Image();
    animage.src = imgsarray[loop];

<body bgcolor="#ffffff" onLoad="thePreload();">

        <!--this is where the main image and thumbnails are-->

        <img src="mainimage1.jpg"  name="mainImage">
        <a href="#"  onClick="document.mainImage.src='mainimage1.jpg'"><img
        <a href="#"  onClick="document.mainImage.src='mainimage2.jpg'"><img
        <a href="#"  onClick="document.mainImage.src='mainimage3.jpg'"><img

More information about the thelist mailing list