Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:05
How to place Main Menu call in the menu_data file?
Poster: BW
Dated: Friday October 10 2003 - 13:42:38 BST
jgillet proposed something that would be very helpful for me.
I am placing the menu in a table cell (as you have already heard ). For each page of the website I have the bit of script that goes in the <head> section and place the "Main Menu" script in the <body> section - or to be more specific, in the <td> cell.
So, in each page I must insert this into the table cell:
<script>
<!--
with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=155;
left=200;
alwaysvisible=1;
orientation="horizontal";
position="relative";
aI("text=Home;url=http://www.brianandcarrie.net/;status=Back To Home Page;");
aI("text=Family;showmenu=Family;status=Quality Time With The Fams...");
aI("text=Fun;showmenu=Fun;status=Fun Things We've Done...");
aI("text=Simon;showmenu=Simon;status=Simon's 'Year in Review' - If He Feels Like It...");
aI("text=Various;showmenu=Various;status=The 'Catch-All' Category...");
aI("text=Guestbook;showmenu=Guestbook;status=Leave A Message For Us!...");
aI("text=Private;showmenu=Private;status=Password Protected (for BnC only)...");
}
drawMenus();
-->
</script>
jgillet said something about putting this script into the menu_data file instead. That would be great 'cause I could make future changes to the many pages with one change to the menu_data file!
I tried to leave only this part:
<script>
drawMenus();
</script>
in the table cell. The menu is displayed, but not in the cell or even the table. It is positioned in the upper RH corner of the page before the table.
So, is there someway to place all the "Main Menu" script into the menu_data file and have it displayed in the desired cell? What kind of syntax would be necessary in the menu_data file and the table cell?
Thanks
BW
Poster: Hergio
Dated: Friday October 10 2003 - 15:15:53 BST
Put your your main menu code AND a drawMenus() call into that js file. And then include it while inside the td tags.
Code:
<td>
<SCRIPT language=Javascript src="otherMenu.js"></SCRIPT>
</td>
otherMenu.js would contain your main menu definition and drawMenus() at the bottom. Is this what you have or have you tried this?
<SCRIPT language=Javascript src="otherMenu.js"></SCRIPT>
</td>
Poster: BW
Dated: Friday October 10 2003 - 15:55:59 BST
Excellent! I followed your instructions and *presto* it works great.
Geez, it's like you have some insight on this script or something
Thanks for the help!
BW the novice
Poster: tepidarium
Dated: Friday October 10 2003 - 16:02:27 BST
Yep, I am doing the same thing with my test page. This forum is really great for support thank you to all.
Poster: Maz
Dated: Friday October 10 2003 - 16:44:57 BST
Wow, keep on learning something new, that's another method from the one I've been using with the whole script inserted.
Regards
maz