jQuery How do I move an element inside of another element
        Posted  
        
            by TripWired
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by TripWired
        
        
        
        Published on 2010-03-23T17:27:11Z
        Indexed on 
            2010/03/23
            17:33 UTC
        
        
        Read the original article
        Hit count: 378
        
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?
© Stack Overflow or respective owner