How to add a CSS class depending on URL path?

后端 未结 3 573
渐次进展
渐次进展 2021-01-26 01:56

How can I add an CSS class to an div depending on what path I am on, including that it should not mather if I had # in it?

3条回答
  •  感动是毒
    2021-01-26 02:12

    none of these worked for me. this works:

    
    

    menu structure:

     
    

    source: http://www.paulund.co.uk/use-jquery-to-highlight-active-menu-item

提交回复
热议问题