Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Show or hide content


Hide and show an article ----------------------------
< html >

< head >

< title > Sample </ title >

< style type = "text/css" ><!--
.article { 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>

</ head >

< body >