Solved

Javascript Navigation Menu - Coding tweak

Posted on 2011-03-08
3
306 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to escape unsafe HTML tags 4 36
Increase counter and attr inside a while loop 15 34
JQuery conflicts/syntax issue 4 23
Why is my $_POST not going to results page 10 32
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to dynamically set the form action using jQuery.

679 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