Forum Moderators: open

Message Too Old, No Replies

sub menus

         

quartzy

2:37 am on Mar 22, 2009 (gmt 0)

10+ Year Member



I am new to javascript and still learning, I have a script that I want to add sub menus too, but I have not got a clue, there is one sub menu but I would like a third level.
<code>
menu_array[0]=new menuItem(0,["&nbsp;Home&nbsp;","&nbsp;Fruit&nbsp;","&nbsp;Dogs&nbsp;","&nbsp;Vegetables&nbsp;","&nbsp;Other&nbsp;"],["menu.html",1,2,3],[0,0,0,0]);
//Fruit
menu_array[1]=new menuItem(1,["&nbsp;Apples&nbsp;","&nbsp;Oranges&nbsp;"],["apple.jpg","orange.jpg"],[0,0]);
//Dogs
menu_array[2]=new menuItem(2,["&nbsp;Wikipedia&nbsp;","&nbsp;Google&nbsp;"],["http://en.wikipedia.org/wiki/Dog",":http://images.google.com/images?svnum=10&hl=en&lr=&q=dog&btnG=Search"],[0,0]);
//Vegetables
menu_array[3]=new menuItem(3,["&nbsp;Green&nbsp;Beans&nbsp;","&nbsp;Squash&nbsp;"],["greenbeans.html","squash.html"],[0,0]);
</code>

the menu array[1] is a sub menu, that I would like to add another level too. Can anyone help me out?

whoisgregg

8:53 pm on Mar 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm afraid I don't recognize the code you are using there, quartzy. And there's nothing about menu_array[1] that sets it apart from the other menu_array's that indicates to me it would be a submenu. :/

Where did the original code come from? Could you post a bit more of the code -- maybe the definition of menuItem()?

quartzy

12:34 pm on Mar 27, 2009 (gmt 0)

10+ Year Member



hello
I am going to try with jscook menu instead, but thanks for getting back to me.