Site logo

[Support request] Assign a class to link when I’m on the current page

Home Forums Support [Support request] Assign a class to link when I’m on the current page

Home Forums Support Assign a class to link when I’m on the current page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2467522
    Diogenes

    Hello.

    Is there a way to assign a class to a block of generateblocks when it is located on the current page?

    I’m making a sticky bar at the bottom of the page (with generatepress elements). In it I have created several blocks with horizontal icons that are linked to certain pages of the website, I would like that when you visit the page that is linked to the icon, a border will be placed around the icon (or background) to indicate that I am in that page, in this way it would give a visual signal that I am there.

    Something like that, like what happens to the navmenu, which changes the color of the link when it is on the current page.

    I hope I have explained myself correctly.
    I appreciate the help.

    #2467546
    Ying
    Staff
    Customer Support

    Hi there,

    I’m sorry but this is out of the scope of GP premium support.

    Here’s a similar case that I found online, it should be helpful:
    https://stackoverflow.com/questions/8185746/javascript-add-class-depending-on-current-url

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.