View Full Version : Help in display menu for javascript

03-30-2010, 09:57 AM
Hi all expert here,

Can anyone guide me on how to write/modified the javascript for display the menu which can support 20 dropdown menu under one parent menu.

Currently I am using coolmenus version 4 which is created by Thomas Brattli but it only support 13 drop down menu, but I do not know how to change to support 20 drop down menu? Anyone got sample for support 20 drop down menu? Thanks.:)

03-31-2010, 02:47 AM
I'm pretty sure that any of these can have unlimited drop down menus.

03-31-2010, 04:27 AM
Do you mean that there is a single menu with 20 different submenus at the SAME LEVEL, or that the menu will have one menu inside another menu inside another menu for 20 levels?

For the first, that should be easy enough to find (and maybe even modify your current script). For the second while there are some "infinite" menus out there, it may be very complex because of screen space and opening 20 menus taking so much of the screen that it won't be possible to fit them all.

I'm hoping you just menu 20 different parts of the same menu and not 20 layers on top of each other, because that should be easy.
If not, then the only approach would be to have a menu that opens toward the left until it hits an edge then toward the right until it hits and edge, and repeat until all layers are opened-- but I'm sure you can see how that wouldn't be fun to use.

03-31-2010, 07:01 AM
hi djr33',

It is the 1st case, may you teach me how to modify?

03-31-2010, 07:35 PM
I'm not sure how to modify it, but in theory that should be easy enough.

Either there is just a limit (no more than 13) somewhere in the programming (and you could remove that or change it to 20), or the setup is based on pre-numbered entries so that "14" does not exist in the script and is then not recognized. In this case, you can find where 1-13 are defined and just cut and paste (changing the numbers) to create new instances as needed.

There is no technical reason why 13 would be the maximum number.

I would suggest looking through the script for any use of "13" or "12" (because it may start counting from 0) and seeing if there is an easy way to modify it from there.

It is also possible that there is not a limit of 13 specifically, but that more than 13 somehow doesn't fit into your layout or memory or something so there is an error triggered by having too many, but not specifically because of 13. This would be a lot harder to fix. You could test to see if this is the problem by changing the size of the window (if it's smaller, it should allow fewer) or making the text items in the menu bigger, or smaller, etc.

If you post a link to the script someone may be able to help you work with it if you need more help.