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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -