Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var url = window.location.href;
- jQuery('.main_nav li').each(function(){
- var menu_item = jQuery(this).find('a').attr('href');
- if (menu_item == url) {
- jQuery(menu_item).parent(li).addClass('active');
- console.log(menu_item);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement