So I have a simple jquery code to highlight the nav menu.
$(document).ready(function(){
$('#header .mm a').each(function(){
if( $(this).attr('href') == window.location.href ){
$(this).addClass('active');
}
var value = window.location.href.substring(window.location.href.lastIndexOf('/') + 1);
if( $(this).attr('href') == '/site/' && (value == '') ){
$(this).addClass('active');
}
});
});
On this page right here: http://perfectlanding.com.au/creativity
I have no idea why the code won’t run. There are no errors in the console.
The code isn’t inside a script tag. Fix that and it should work fine.