Click here to Skip to main content
15,878,871 members
Articles / Web Development / HTML

DMenu, DHTML Menu

Rate me:
Please Sign up or sign in to vote.
4.83/5 (32 votes)
24 Oct 200211 min read 350.9K   3.8K   110  
A DHTML menu illustrating seperation of structure, presentation and function
<!--
function showSubMenu(){
	var objThis = this;	

	for(var i = 0; i  < objThis.childNodes.length; i++)
	{
		if(objThis.childNodes.item(i).nodeName == "UL")			
		{							
			objThis.childNodes.item(i).style.display = "block";						
		}		
	}	
}

function hideSubMenu()
{								
	var objThis = this;	
	
	for(var i = 0; i  < objThis.childNodes.length; i++)			
	{
		if(objThis.childNodes.item(i).nodeName == "UL")
		{				
			objThis.childNodes.item(i).style.display = "none";			
			return;
		}			
	}	
}			

function initialiseMenu()
{
	var objLICollection = document.body.getElementsByTagName("LI");		
	for(var i = 0; i < objLICollection.length; i++)
	{		
		var objLI = objLICollection[i];										
		for(var j = 0; j  < objLI.childNodes.length; j++)
		{
			if(objLI.childNodes.item(j).nodeName == "UL")
			{
				objLI.onmouseover=showSubMenu;
				objLI.onmouseout=hideSubMenu;
				
				for(var j = 0; j  < objLI.childNodes.length; j++)
				{
					if(objLI.childNodes.item(j).nodeName == "A")
					{					
						objLI.childNodes.item(j).className = "hassubmenu";								
					}
				}
			}
		}
	}
}
-->

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer Caliber AI
South Africa South Africa
My name is Paul Watson and I have been a professional web-developer since 1997. I live and work remotely from Cape Town, South Africa.

I have many years of experience with HTML, CSS, JavaScript, PostgreSQL, and Ruby on Rails. I am capable in Python and Machine Learning too.

Currently I am the CTO of CaliberAI. Formerly I worked with Kinzen (CTO & co-founder), Storyful (CTO, acquired by News Corp), FeedHenry (co-founder, acquired by Red Hat), and ChangeX.

Now that you know a bit about me why not say hello.

Comments and Discussions