MyBB Community Forums

Full Version: how to create a navigation drop down menu but on click?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I think this can be done with javascript but because i dont know i would like to ask your help..

That i want is when someone clicks the nav to show up the drop down but on click and not in hover..

Here is the code i hope you can help me out.

Html:

<nav>
	<ul>
	
		<li><a href="#">Nav</a>
			<ul>
				<li><a href="#">Drop Menu 1</a></li>
				<li><a href="#">Drop Menu 2</a>
					</li>
	</ul>
</nav>

CSS:
nav ul ul {
	display: none;
}

	nav ul li:hover > ul {
		display: block;
	}


	nav ul {
 
	list-style: none;
	position: relative;
	display: inline-table;
}
	nav ul:after {
		content: ""; clear: both; display: block;
	}

thanks for any kind of help.I dont know if is the right section to post it...but i was just looking for help;p
see Google search results for such menu codes