Use jquery to put sub menus in new div -


i have menu sub menus. want use jquery move sub menus (unordered lists) expanding div. example, have menu looks this:

<ul id="menu">     <li>         <ul class="sub-menu">...</ul>     </li>     <li>         <ul class="sub-menu">...</ul>     </li>     <li>         <ul class="sub-menu">...</ul>     </li> </ul> 

and each .sub-menu moved containing div below. able 1 .sub-menu with:

var put = jquery( ".sub-menu").html(); jquery('#nav-expand').html(put); 

but each one. tried using .each() either using incorrectly or need solution.

you should use appendto method in jquery move element

http://api.jquery.com/appendto/

$( ".sub-menu" ).appendto( "#nav-expand" ); 

http://jsfiddle.net/qtwbb/


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -