I'm using this code
$(document).ready(function () {
$(function () {
$('li a[href^="../../' + location.pathname.split("/")[1] + '"]').addClass('active');
});
});
to highlight my navigation, depending on which page I'am.
It works fine and highlights only one link from navigation if I'm on for example http://test.com/content
, but when I get on home page aka http://test.com/
It highlights all of the li from navigations at once..
Tried to reproduce it in jsfiddle... but couldnt cause it would then redirect you to some other page or tell that page does not exists
Is there anything I can do?