I have used following js and css in one of my projects if its any help for you.
It will compare current url with menu links and add "active-menu-item" class to li element.
- Code: Select all
jQuery("#main-menu > li > a").each(function() {
if (this.href == window.location.href) {
jQuery(this).parent().addClass("active-menu-item");
}
});
Then to style it use following css code as an example changing background color or changing text "Tour" text color.
- Code: Select all
#main-menu .active-menu-item:hover { background: #000000; }
#main-menu .active-menu-item a { color:#ffffff; background: #000000; }
See you around...