jQuery How do I move an element inside of another element
- by TripWired
Hi I'm using grails navigation plugin and when it generates menus it put the sub navigation underneath the main menu, but i'm making my menu a vertical menu so i don't want the sub menu under the whole menu i want it under the active element.
Example: this is how it generate the menu and sub menu
<ul class="mainmenu">
<li>item1</li>
<li>item2</li>
<li>item3</li>
</ul>
<ul class="submenu">
<li>item1</li>
<li>item2</li>
<li>item3</li>
</ul>
What i want is:
<ul class="mainmenu">
<li>item1
<ul class="submenu">
<li>item1</li>
<li>item2</li>
<li>item3</li>
</ul>
</li>
<li>item2</li>
<li>item3</li>
</ul>
Since i don't know of a way to make grails nav plugin do this i guess i'll have to make jquery do it after it's generated. Any ideas?