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" );
Comments
Post a Comment