• Resolved JenWebDev

    (@jenwebdev)


    Site under construction. When my page loads, I’m gettting the first two menu items highlighted I need to remove the second highlight. The documentation says the plugin adds -first and -last when multiple items are highlighted, but it’s not doing that.

    I have “only highlight one item at a time” checked, but it’s not working in this case. “Prevent other scripts from handling plugin’s links” is also checked. The first two items remain highlighted unless I shorten the browser window so the second section is well out of view.

    This is a twentytwenty-child theme.

    Is there a way to override this or designate the second highlighted item? I’ve tried adding
    <script>document.getElementsByClassName('mPS2id-highlight')[1].style.color = '#482E42';</script>
    to the header, which worked in another site, but it’s not working on this one.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author malihu

    (@malihu)

    Hi,

    Disable “Allow only one highlighted element at a time” option. When it’s enabled, “-first” and “-last” classes do not apply, so disable the option.

    Also, it’s better in your case to add a highlight selector, so add the following value in “Highlight selector(s)” option:

    .primary-menu a

    Doing this you’ll be able to use mPS2id-highlight-first class in your CSS.

    You could also use your existing target ids (“#about-section”, “#home-section” etc.) instead of the ones you added (“#about”, “#home” etc.) but you’d need to disable “Highlight by next target” option for that.

    Let me know

    Thread Starter JenWebDev

    (@jenwebdev)

    The last suggestion got it, thank you.

    Plugin Author malihu

    (@malihu)

    You’re welcome 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Plugin not adding -first / -last to highlight classes’ is closed to new replies.