[Javascript] Layers

Andrew Dunn adunn at mail.interworx.com.au
Thu May 17 08:46:42 CDT 2001


Hi again,
	   I've decided to scrap the idea of supporting netscape 4 browsers as I
need more than two layers. The page I am applying this too is a limited
access page and can be only viewed by one person anyhow, the guy who will be
viewing it uses IE, but I still wish to support netscape 6 just in case he
decides to change in the future. I can not get this function to work in
Netscape 6. Peter, i've read over your information and have revised the
functions as follows:

if(document.all)
	{
		layer = ".all[";
		style = "].style";
	}
	else if(document.getElementById)
	{
		layer = ".getElementByID(";
		style = ").style";
	}

changing the layers:

eval("document" + layer + "'SectionT'" + style + ".visibility = 'visible'");

Can anyone see why netscape 6 doesn't like this function?

Thank you.


>function checkBrowser()
>{
>	if(navigator.userAgent.indexOf("MS") != -1)
>	{

*** Don't use a browser detect, use a support detect. ***

This function does not work in Netscape 6, Opera and Konqueror while they
can easily handle the script. Why don't you give them a chance to execute
it, too?

For information on how to avoid this, see
http://www.xs4all.nl/~ppk/js/index.html?support.html (for general info about
support detection) and
http://www.xs4all.nl/~ppk/js/index.html?dom.html (the three DOMs you need
for cross-browser DHTML).

This is really a very important topic, so please read these pages carefully.

>Can anyone see the flaw that would cause netscape to crash? This works fine
>in IE.

The flaw is not in the JavaScript, probably in the style sheets.

Step 1) Remove all border declarations from the style sheets, see if that
helps.
Step 2) If it doesn't, try to reduce the number of layers (or do you have
only 2?)
Step 3) If it still doesn't work, post a URL so we can take a look.

ppk

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list