Active Menu Highlight CSS

后端 未结 11 905
孤独总比滥情好
孤独总比滥情好 2020-11-29 00:54

I want to highlight the current menu you have click. I\'m using CSS, but it is now working.

here is my css code:

#sub-header ul li:hover{ background-         


        
11条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-29 01:51

    add simply way

    $("document").ready(function(){ $(function() { $('.cssmenu a[href="' + location.pathname.split("/")[location.pathname.split("/").length-1] + '"]').parent().addClass('active'); }); });

提交回复
热议问题