views:

255

answers:

1

Greetings,

I got the following problem:

On this page (it's /not/ mine, I'm taking it just as an example) you can see under

  1. non-accordion (standard expandable menu)

a ,as the name tells, a standard expandable menu. Now the question that I got:

Is it possible to add by e.g. clicking on a button, to add another menu item, so that instead of 5 items, we got than 6,7,8 ...etc.

If yes, what would be the best way to realize it ? What would be required (e.g. an live()/Event handler) ?

Best regards and thanks in advance,

Leejin

A: 

You can add elements to that menu with jQuery clone(). After adding new element , you might have to rebind/restart the accordion effect/function though, otheriwse it might not work on new element.

Zayatzz
Thank you for the answer.Can you tell me how the rebind/restart of the accordion can be achieved ?
NullPointerException
exactly the way it was done the first time- by calling initMenus() i guess.
Zayatzz