Forum Discussion

Kev_B's avatar
Kev_B
Advisor
8 years ago

Using jQuery addClass not working

Hi all,   I'm trying to use jQuery to target the current URL and dynamically add the 'active' class to the <a> tag in our global navigation. I've nicked the existing blog page layout to create a ne...
  • PaoloT's avatar
    8 years ago

    Hi Kev_B

     

    not sure why this would not work without seeing the actual full page etc.

     

    However - I am assuming you want to highlight the area within the community structure the user is in. In that case, have you checked out the coreNode context object in Freemarker? You should be able to do this in a much easier way by using ${coreNode.id} (and possibly other properties of that object) to detect the node you are in and highlight the appropriate value without inspecting the page URL.

     

    Hope it helps,