Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Friday, January 7th, 2005

Time Event
7:30p
Hide/Show Layer script
Head script

<script>
function hideshowlayer(LayerName) {

var VState = document.getElementById(LayerName).style.display;

document.title = LayerName +" "+document.getElementById(LayerName).style.display;

if (VState=="inline") {
document.getElementById(LayerName).style.display = "none";
}

if (VState=="none") {
document.getElementById(LayerName).style.display = "inline";
}

} //end function
</script>

Body

<a href='javascript:hideshowlayer("layer1");'>hide/show</a><br>
<span id="layer1" style="visibility: visible; display:inline; ">
<b>Showinglayer 1</b>
</span>


Tested on Internet Explorer 5.2 (Macintosh), FireFox 1.0 (Macintosh)
Thanks for the help from Imageadcott and Imagesaint_sava
Crossposted to Imagejavascript and Image_css

<< Previous Day 2005/01/07
[Calendar]
Next Day >>
About LiveJournal.com
Image