How to place Main Menu call in the menu_data file?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
BW
Beginner
Beginner
Posts: 7
Joined: Wed Sep 24, 2003 9:09 pm

How to place Main Menu call in the menu_data file?

Post by BW »

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
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Put your your main menu code AND a drawMenus() call into that js file. And then include it while inside the td tags.

Code: Select all

<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?
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
BW
Beginner
Beginner
Posts: 7
Joined: Wed Sep 24, 2003 9:09 pm

Post by BW »

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
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

Yep, I am doing the same thing with my test page. This forum is really great for support thank you to all.
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Wow, keep on learning something new, that's another method from the one I've been using with the whole script inserted.

Regards
maz
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

See my e-mail...
John
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

You talking to me? Which one? hehe

Hey thank you for the gracious words, we REALLY appreciate them. It makes it fun to help out on this forum when you have people willing to learn.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Hergio wrote:You talking to me? Which one? hehe
Nope, that was directed at Maz. Just followin' the bread crumbs down the page...
John
Post Reply