Return to Snippet

Revision: 2937
at May 11, 2007 13:28 by cmslounge


Initial Code
function toggleLayer(whichLayer) {
	if (document.getElementById)	{
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	} 	else if (document.all)	{
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}	else if (document.layers)	{
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}

Initial URL

                                

Initial Description

                                

Initial Title
Javascript toggle a div layer visibility

Initial Tags
javascript

Initial Language
JavaScript