PDA

View Full Version : All Levels Navigational Menu



khouran
03-20-2009, 08:33 PM
1) Script Title: All Levels Navigational Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/index.htm

3) Describe problem: Question on this menu. It states that you add the HTML for the drop down menus to the body tag. That would mean for every single page of a site, correct? There isn't a way to add it to a header include file, so that it would work on all pages that include that header?

molendijk
03-20-2009, 08:53 PM
You could use Ajax to include the HTML, or you could put the HTML in a file called menu.html, and then put the following lines in an external js-file, say include.js, which would contain the following lines:

if(window.opera)
{document.write('<iframe src="menu.html" width="0" height="0" name="menu" ></iframe>');}
else document.write('<object type="text/html" data="menu.html" width="0" height="0" name="menu" ></object>');
function extractMenu(){
try{
document.body.innerHTML+=window.frames['menu'].body.innerHTML;
}
catch(e){
document.body.innerHTML+=window.frames['menu'].document.body.innerHTML;
}
}
window.onload=extractMenu;
and which is included on every page by putting this in the head of the pages:
<script type="text/javascript" src="include.js"></script> (the styles and css for the menu (written in menu.html) must also be put in the head of every page (not in menu.html).

Or: try this (http://www.dynamicdrive.com/forums/blog.php?b=13).
===
Arie.

khouran
03-21-2009, 03:41 PM
If I place this code in an include file:

[code]<div id="ddtopmenubar" class="mattblackmenu">


<ul>
<li><a href="../personal/index_new.asp" rel="ddsubmenu1">PERSONAL</a></li>
<li><a href="../business/index.asp" rel="ddsubmenu2">BUSINESS</a></li>
<li><a href="../investor/index.asp" rel="ddsubmenu3">INVESTOR</a></li>
<li><a href="../about/index.asp" rel="ddsubmenu4">ABOUT US</a></li>
</ul>
</div>

<script type="text/javascript">
ddlevelsmenu.setup("ddtopmenubar", "topbar") //ddlevelsmenu.setup("mainmenuid", "topbar")
</script>[code]


And this file is called after the body tag in an asp page: <!-- #include virtual="/includes/section_index_head3.inc" -->


Because it is after the <body> tag in the page, can I also include the rest of the html for the menu in this file, or does it need to be separate?

I got the menu to appear - with the top level links that work - but the drop-down functinoality does not work. No arrows, no drop-down - nothing.

molendijk
03-21-2009, 03:52 PM
I don't know how it works in asp page. I only tested it in html-pages, like here (http://molendijk.110mb.com/include_menu11/file1.html).
===
Arie.

khouran
03-21-2009, 04:52 PM
I have tried the smooth navigational menu and now the all levels navigational menu -

The main top level menu looks and works great - however, I can't get the arrows or drop-downs to appear at all. Very frustrating.

I can't post my entire code on here. All I can say is that I have an include file (header) that's called within the body of all of my pages and for whatever reason, as I said above, the arrow and sub-menus do not work. Would it be that the .js file is just not being called at all?