ejochum
asked on
Javascript Navigation Menu - Coding tweak
I need a three level, acordion style navigation menu built. I currently have what I would like, but in a two-level format. Please see attached files for the coding and an image of what I am looking for.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
<head>
<script type="text/javascript" src="LINK"></script>
<script type="text/javascript" src="LINK">
/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
<script type="text/javascript">
ddaccordion.init({
headerclass: "submenuheader", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["suffix", "<img src='LINK' class='statusicon' />", "<img src='LINK' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "normal" //speed of animation: "fast", "normal", or "slow"
})
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
</script>
<style type="text/css">
.glossymenu{
background:#ee2e24;
margin: 0px 0;
padding: 0;
width: 150px; /*width of menu*/
border: 1px solid #9A9A9A;
border-bottom-width: 0;
}
.glossymenu a.menuitem{
font: bold 11px "Arial", Helvetica, sans-serif;
color:#FFFFFF;
display: block;
position: relative; /*To help in the anchoring of the ".statusicon" icon image*/
width: auto;
padding: 4px 0;
padding-left: 10px;
text-decoration: none;
}
.glossymenu a.menuitem .statusicon{ /*CSS for icon image that gets dynamically added to headers*/
position: absolute;
top: 4px;
right: 5px;
border: none;
}
.glossymenu div.submenu{ /*DIV that contains each sub menu*/
background:#FFFFFF;
color:#000000;
}
.glossymenu div.submenu ul{ /*UL of each sub menu*/
list-style-type: none;
background-color:#FFFFFF;
margin: 0;
padding: 0;
}
.glossymenu div.submenu ul li{
border-bottom: 1px solid black;
}
.glossymenu div.submenu ul li a{
display: block;
font: normal 11px "Arial", sans-serif;
color:#000000;
text-decoration: none;
padding: 2px 0;
padding-left: 10px;
}
</style>
<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:ContentType msdt:dt="string">Master Page</mso:ContentType>
<mso:MasterPageDescription msdt:dt="string"></mso:MasterPageDescription>
</mso:CustomDocumentProperties>
</xml><![endif]-->
<!--mstheme--><link rel="stylesheet" type="text/css" id="onetidThemeCSS" href="LINK"><meta name="Microsoft Theme" content="simple 1011, default">
</head>
<body topmargin="0" leftmargin="0">
<table border="0" height="">
<tr>
<td valign="top" background="LINK" height="">
<span class="ms-menutoolbar">
<div class="glossymenu" ><a class="menuitem" href="LINK" target="body">Home</a>
<a class="menuitem submenuheader" href="" target="body" >BLANK</a>
<div class="submenu" style="color:#000000">
<ul class="glossymenu">
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a> </li>
<li><a href="LINK" target="_top">BLANK</a></li>
</ul>
</div>
<a class="menuitem submenuheader" href="#" >BLANK</a>
<div class="submenu">
<ul class="glossymenu">
<li><a href="LINK" target="_top">BLANK</a></li>
</ul>
</div>
<a class="menuitem submenuheader" href="#">BLANK</a>
<div class="submenu">
<ul class="glossymenu">
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a> </li>
</ul>
</div>
<a class="menuitem submenuheader" href="#" >BLANK</a>
<div class="submenu">
<ul class="glossymenu">
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top" >BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a></li>
<li><a href="LINK" target="_top">BLANK</a><a href="LINK" target="_top"></a></li>
</ul>
</div>
</html>
Nav-Menu-Example.JPG
ASKER
WhiteSeed,
I'm not sure how to "initialize" the script. Can you attach a notepad document with that script?
Thanks
I'm not sure how to "initialize" the script. Can you attach a notepad document with that script?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.scriptiny.com/2008/11/drop-down-menu/