Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $( ".menu-item-has-children > a" ).click(function(e) {
- $(".sub-menu").hide();
- e.preventDefault();
- $(this).parent().find(".sub-menu").first().slideToggle();
- });
- $(".menu-item-has-children > a").each(function(e) {
- var sub = $(this).parent().find(".sub-menu");
- var text = $(this).text();
- $(this).html(text+' <i class="fa fa-plus"></i> ');
- var link = $(this).attr("href");
- sub.prepend('<li><a href="'+link+'">'+text+'</a></li>');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement