Solved

Javascript Navigation Menu - Coding tweak

Posted on 2011-03-08
3
301 Views
Last Modified: 2012-05-11
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>

Open in new window

Nav-Menu-Example.JPG
0
Comment
Question by:ejochum
  • 2
3 Comments
 
LVL 4

Expert Comment

by:WhiteSeed
ID: 35069131
hello, I used this example to create what you are looking for on site:
http://www.scriptiny.com/2008/11/drop-down-menu/
0
 

Author Comment

by:ejochum
ID: 35069171
WhiteSeed,

I'm not sure how to "initialize" the script.  Can you attach a notepad document with that script?

Thanks
0
 
LVL 4

Accepted Solution

by:
WhiteSeed earned 500 total points
ID: 35069494
here you can download the full source file whit the example:
http://forum.leigeber.com/index.php?app=downloads&module=display&section=download&do=confirm_download&id=7

Open in new window


to initialize use:
var menu=new menu.dd('menu');

Open in new window

where 'menu'  is the name of the object and
menu.init('menu');

Open in new window

where 'menu' the id of the menu unordered list

I'm in a hurry and can not make a more detailed example if you need i will come back in a few hours
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now