Embedding menus in a table

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
erin
Beginner
Beginner
Posts: 2
Joined: Mon May 02, 2005 10:42 pm

Embedding menus in a table

Post by erin »

I'm having trouble embedding the text in my table. The instructions are confusing and now my code is broken. Can anyone help with this issue?

erin
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Erin,

You have a menu data file. In it you have the styles and the main menu and submenus and at the end a drawmenus(); You would open you menu data file, and you would cut out the main menu. Then you paste that menu into the table cell where you want it and include at the end a drawmenus(); so you'd have one of those in the menu data file and in the table cell. Then enclose that main menu in script tags. Save your menu data file without the main menu in it and call it right after the body tag with the other 3 Milonic base files milonic_src.js, mmenudom.js and mmenuns4.js. As an example:

Code: Select all

<body>The calls for the menu files plus the menu_data.js file go here
<table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td><script>with(main=new menuname("Main Menu")){
style=menuStyle;
orientation="horizontal";
alwaysvisible=1;
position="relative";
aI("text=Item1 ;");
aI("text=Item3;");
aI("text=Color;");
}drawmenus();</script></td><td></td></tr></table>
You would of course use your own main menu and table structure.
Ruth
erin
Beginner
Beginner
Posts: 2
Joined: Mon May 02, 2005 10:42 pm

I'm not quite there

Post by erin »

I understand cutting the main menu data from my .js file and pasting it, with the end drawMenus(); into the tabel cell in the body of my html page.

However, the menu is not showing up in the cell where I placed the code. I renamed the file it calls embedded_main_menu.js and copied the code from the help page on embedding a menu inside a table cell.

This is a small site for a non-profit environmental film festival. You can view the file at :
http://www.growdesign.net/grow/site/index_script.html

I appreciate any more assistance you can provide.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Erin,

I'm sure Ruth won't mind me jumping in here... that is, if she hasn't already posted a reply as I type this (which she has done to me lately!)

Thanks for posting a url... makes it much easier to see what's going on, which was crucial in this case... because I see something odd in the code of your index_script.html file. You have several Ý characters instead of spaces in the js code that loads the base milonic scripts. Your code currently looks like this:

Code: Select all

 <SCRIPT type="text/javascript" src="milonic_src.js"></SCRIPT> 
 <paramÝcopyright="JavaScriptÝMenuÝbyÝMilonicÝhttp://milonic.com"></param>
 <script type="text/javascript">
 <!-- 
 if(ns4)_d.write("<SCR"+"IPTÝLANGUAGE=JavaScriptÝSRC=mmenuns4.js><\/SCR"+"IPT>");
 else _d.write("<SCR"+"IPTÝLANGUAGE=JavaScriptÝSRC=mmenudom.js><\/SCR"+"IPT>"); 
 -->
 </SCRIPT>
Those Ý characters are breaking the code. Replace them with spaces, or copy the following code and paste it to replace what you have.

Code: Select all

<SCRIPT type="text/javascript" src="milonic_src.js"></SCRIPT>
<param copyright="JavaScript Menu by Milonic http://milonic.com"></param>
<script type="text/javascript">
<!--
if(ns4)_d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=mmenuns4.js><\/SCR"+"IPT>");
else _d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=mmenudom.js><\/SCR"+"IPT>");
-->
</SCRIPT>
BTW, a suggestion if you don't mind. Your menu's onbgcolor exactly matches the background color of your page. When the pointer is over a menu item, the item's background blends into the page's background, which, to me, makes the menu lose a little cohesion. I'd suggest a different onbgcolor... but that's just me.

Hope that helps,

Kevin
Post Reply