Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function($){
  2.   // Add class .active to current link
  3.   var cUrl = String(window.location).split('?')[0];
  4.  
  5.   if (cUrl.substr(cUrl.length - 1) == '#') {
  6.     cUrl = cUrl.slice(0,-1);
  7.  
  8.     $.navigation.find('a').each(function(){
  9.       if (cUrl.includes(this.href)) {
  10.         $(this).parents('ul').add(this).each(function(){
  11.           $(this).parent().addClass('open');
  12.         });
  13.       }
  14.     });
  15.   }
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement