Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q699 Is there any way to detect if a Netscape Navigator 4 or higher user has disabled Style Sheets in users preferences setting?

irt.org | Knowledge Base | DHTML | Q699 [ previous next ]

Q699 Is there any way to detect if a Netscape Navigator 4 or higher user has disabled Style Sheets in users preferences setting?

In Netscape Navigator 4 you can attempt to detect for the existence of the a layer. Here is a snippet of code I use for checking before revealing or highlighting a layer:

<STYLE type="text/css"><!--
.myLayers {
    position: absolute;
    visibility: hidden;
}
//--></STYLE>

<SCRIPT TYPE="text/JavaScript" LANGUAGE="JavaScript"><!--
function show(object) { if (document.layers && document.layers[object] != null) document.layers[object].visibility = 'visible'; else if (document.all) document.all[object].style.visibility = 'visible'; }
function hide(object) { if (document.layers && document.layers[object] != null) document.layers[object].visibility = 'hidden'; else if (document.all) document.all[object].style.visibility = 'hidden'; }
//--></SCRIPT>

<A HREF="somewhere.htm" onMouseOver=show('a')" onMouseOut="hide('a')">text link</A>

<DIV ID="a" CLASS="myLayers>"Waffle, waffle, waffle!</DIV>

The document.layers[object] != null part detects if the object ('a') exists. If it doesn't then you can be certain that either the browser doesn't support layers, or that the user has disabled style sheet support.


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.