JavaScript Sliding Menu

 

Example

JavaScript Menu1

JavaScript submenu1 would be here
JavaScript submenu1 would be here
JavaScript submenu1 would be here
JavaScript submenu1 would be here

JavaScript Menu2

JavaScript submenu2 would be here
JavaScript submenu2 would be here
JavaScript submenu2 would be here

JavaScript Menu3

JavaScript submenu3 would be here
JavaScript submenu3 would be here

 

Script Source

<Under the head section>

<script type="text/javascript" language="javascript">
<!-- Hide script from old browsers

function toggleMenu(currMenu) {
if (document.getElementById) {
thisMenu = document.getElementById(currMenu).style
if (thisMenu.display == "block") {
thisMenu.display = "none"
}
else {
thisMenu.display = "block"
}
return false
}
else {
return true
}
}
// End hiding script -->
// Script by www.wizzardweb.co.uk
// Please do not remove this information -- Copyright 2007
</script>
<style type="text/css">

<!--
.menu {display:none; margin-left:20px}
-->
</style>

<Under the body section>

<h1>JavaScript Sliding Menu</h1>
<h3>
<a href="" onclick="return toggleMenu('menu1')">JavaScript Menu1</a>
</h3>
<span class="menu" id="menu1">
JavaScript submenu1 would be here<br />
JavaScript submenu1 would be here<br />
JavaScript submenu1 would be here<br />
JavaScript submenu1 would be here
</span>
<h3>
<a href="page2.html" onclick="return toggleMenu('menu2')">JavaScript Menu2</a>
</h3>
<span class="menu" id="menu2">
JavaScript submenu2 would be here<br/>
JavaScript submenu2 would be here<br/>
JavaScript submenu2 would be here
</span>
<h3>
<a href="page3.html" onclick="return toggleMenu('menu3')">JavaScript Menu3</a>
</h3>
<span class="menu" id="menu3">
JavaScript submenu3 would be here<br />
JavaScript submenu3would be here
</span>

Please let me know if this script was helpful to you.

[rating]