Menu Display Problems

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

I would have liked to have the single call in the proper <td> without actually defining the menu in the html page - but it seems that it just won't work without obscuring the form element. Kevin's solution, as outlined in the tablebound example - where the main menu code is physically placed on the page seems to be the only way I can implement the menu.
Ah... but there are usually alternatives! Try this: instead of embedding the Main Menu script in the html page, put it in a .js file. Maybe call it main_menu.js! Then, in your <td>, load the main_menu.js file like you had been doing with menu_data.js; so you're loading the main_menu.js into the table. "But wait!" you say... "I thought it wasn't cool to load those scripts in a table!" Well, I think the size of the script file has something to do with the odd behavior; smaller ones seem to do OK. I tried this approach with your earlier test page, and it worked fine. You can download the example here. You'll notice that I removed the commented code and placed the menu scripts in the <head> (but in the body should also work). Again, please let me know when you've downloaded it.

Hope that helps,

Kevin
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

Kevin, That is awesome! I jut downloaded it and it works exactly as you described...now, I only need edit the one main menu js file if I need to augment it...so it won't have to be hard wired into the page! Thanks!
Post Reply