Virajsinh

JavaScript Multiple Menu Active

Jan 2nd, 2020
46
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //JavaScript Multiple Menu Active Class
  2.  
  3. var url = window.location.href;
  4. $('ul.sidebar-menu a').filter(function () {
  5.   return this.href == url;
  6. }).parents('li').addClass('active');
RAW Paste Data