Return to Snippet

Revision: 234
at July 6, 2006 00:13 by 1man


Initial Code
function enableRightNavExpand() {
  	if (!document.getElementById) return false;
	if (!document.getElementById("rightNav")) return false;
	var nav = document.getElementById("rightNav");
	var navItem = nav.getElementsByTagName("li");
	for (var i = 0; i < navItem.length; i++){
		navItem[i].onclick=function() {
			if (this.className == "selected") {
				this.className = "";
			}
			else if (this.className == ""){
				this.className = "selected";
			}
		}
	}
}

Initial URL


Initial Description
This script allows you to show and hide a  at the click of a button. See Show / Hide HTML for Markup.

Initial Title
Show / Hide an unordered list

Initial Tags
navigation

Initial Language
JavaScript