Solved

Javascript Navigation Menu - Coding tweak

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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 style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

867 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

15 Experts available now in Live!

Get 1:1 Help Now