Show/Hide Inline Layers

Over 2000+ free Javascript
at Website

Sampled by






The layers you wish to show and hide can be placed anywhere in your document, even in a cell of a centered table. This can be accomplished by nesting the layers within a relative-positioned div.

You can save or view this document's source code using your browser menu commands.

The Code

The code is very simple. It is the same as that for showing and hiding absolute-positioned layers except for an extra bit of code to help Netscape 4 find a reference to the nested layers.

Style specifications for the layers are set in a style sheet in the head of the document. Inline style specifications often cause problems for Netscape 4.