Re: Need help with Netscape DOM

by Jim Coffield <coffield(at)cet.edu>

 Date:  Fri, 26 May 2000 19:03:29 -0500
 To:  Wise Lisa M Civ 355 TRS/RTS <Lisa.Wise(at)dm.af.mil>,
hwg-languages(at)hwg.org
 In-Reply-To:  af
  todo: View Thread, Original
Hi,

I looked at your page. If you take the images out of the table and use
<div> tags with absolute positioning it works fine (but does not look very
good unless you position all of the elements with style sheets).  I have
tried to avoid using relatively positioned layers in Netscape and always
have my absolutely positioned layers isolated (ie. not within tables, or
forms, etc. though you can put tables and forms within the layers). This
does not mean it can't be done, I just don't know how. In the case of your
page, I don't really see the need of adding the complication of layers. The
following code produces the same affect with only image swaps.

(api.js)

//rollover functions

function imgDn(imgName) {

 	if (document.images) {
    	document.images[imgName].src = eval(imgName + "dn.src");

	}
}

function imgUp(imgName) {

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

//end rollover functions

(navLoad.js)

Time = new Array();
Seq = new Array();
Seq[0] = new Array();
Seq[0][1]="begin();";
Seq[0][10]="imgDn('img1');";
Seq[0][14]="imgUp('img1');";
Seq[0][15]="imgDn('img2');";
Seq[0][19]="imgUp('img2');";
Seq[0][20]="imgDn('img3');";
Seq[0][24]="imgUp('img3');";
Seq[0][25]="imgDn('img4');";
Seq[0][29]="imgUp('img4');";
Seq[0][30]="imgDn('img5');";
Seq[0][34]="imgUp('img5');";

(index.shtml)

<TD><A  href="webservices.shtml" onMouseOut="imgUp('img1')"
onMouseOver="imgDn('img1')"><IMG src="images/blank.gif" width="110"
height="20" NAME="img1" BORDER="0" ALT="Click to go to Web
Services"></A></TD>
        </TR>
        <TR>
          <TD>&nbsp;</TD>
        </TR>
        <TR>

    <TD><A HREF="copyservices.shtml" onMouseOut="imgUp('img2')"
onMouseOver="imgDn('img2')"><IMG SRC="images/blank.gif" WIDTH="110"
HEIGHT="20" NAME="img2" BORDER="0" ALT="Click to go to Copy
Services"></A></TD>
        </TR>
        <TR>
          <TD>&nbsp;</TD>
        </TR>
        <TR>

...etc.



-Where blank.gif is a transparent gif the same size as your other images.

I hope this helps.

Jim

>Hi, new to this list and I need some help.
>
>Need help with a Netscape specific problem.  My script shows each button's
>lit-up state, then swaps its source to the un-lit state, then does the same
>thing to the next button and so on.  It works in IE, but not in Netscape.
>I've narrowed the problem to:    The anchor tag around the image has an ID
>to make it work properly and Netscape then doesn't find the image using
>"document.[imgName]"    When I take out the ID, the rollover works, but not
>the loading script. I also tried accessing it with
>"document.layers[imgName]", but that didn't work either.
>
>You can see the page at http://64.33.80.168/ which calls the external
>javaScript files.  The image swap functions in question are in "api.js" and
>the sequence function that calls the show and swap are in "navload.js"
>
>Any help you can provide would be GREATLY appreciated (keep it simple,
>though, because I'm still a scripting newbie).  By the way, any other
>thoughts and comments on my site are more than welcomed.
>
>****************************************************************************
>*******************************
>Lisa Wise
>DeclareIt.com  - http://64.33.80.168
>" Computers are useless. They can only give you answers."  -   Pablo Picasso
>(1881-1973)


James E. Coffield, Ph.D.
Research Associate
Center for Educational Technologies/
NASA Classroom of the Future
Wheeling Jesuit University
316 Washington Avenue
Wheeling, WV  26003
Phone (304) 243-2469      Fax: 304-243-2497
WWW address:  http://www.cet.edu/
email: coffield(at)cet.edu

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