Make This Work?

Sep 07, 2006 10:46

I'm trying to make a page with some pop-out and drop-down menus. I have found a script that pretty much does what I want, but I can't get it to work for multiple menus on the same page (it is supposed to be capable of this).

If anyone is so inclined, please have a look at the following code. (posted as a test page on my webspace ( Read more... )

menu, code, web, hacking, help, work, html, java

Leave a comment

Comments 2

You should use Flash instead. armlesstigerman September 8 2006, 22:13:14 UTC
Javascript is sooooo 1995. But if you must-
The problem was in the createStyles() function. This is called every time showMenus() is called, which is once per each menu. Here:

styleBorder=(menuStyle.split(",")[quant-1].toLowerCase() == "flat")?cellBorder:0

is the problem. the split function breaks strings into arrays. The delimiter used is "," so all the variables that are split should look like this:

menuWidth = "0,0"

which of course is mentioned NOWHERE in the comments.
So basically, you should number your new menu arrays consecutively, and these should correspond to the comma separated values in the Format Menu section. Also,don't forget to increment the quantity variable on line 85. This seems to control the submenus disappearing when you roll over another menu section.

example:
sample menu

Reply

Re: You should use Flash instead. thrasymachos September 8 2006, 22:36:38 UTC
we don't use the latest version of flash on the work computers (this is for a work project) so more mundane solutions must suffice.

Thanks for making it work! You = the Man.

Reply


Leave a comment

Up