Advertisement
developerjustin

Untitled

Mar 11th, 2014
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         $( ".menu-item-has-children > a" ).click(function(e) {
  2.             $(".sub-menu").hide();
  3.             e.preventDefault();
  4.             $(this).parent().find(".sub-menu").first().slideToggle();                          
  5.         });
  6.        
  7.        
  8.         $(".menu-item-has-children > a").each(function(e) {
  9.             var sub = $(this).parent().find(".sub-menu");
  10.             var text = $(this).text();
  11.             $(this).html(text+' <i class="fa fa-plus"></i> ');
  12.             var link = $(this).attr("href");
  13.             sub.prepend('<li><a href="'+link+'">'+text+'</a></li>');                   
  14.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement