Navigation Menu Links All Showing Active State on One-Page Layout

Home Forums Jevelin Theme Navigation Menu Links All Showing Active State on One-Page Layout

Home Forums Jevelin Theme Navigation Menu Links All Showing Active State on One-Page Layout

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • randallrbaker
    Participant

    Hi Shufflehound Support Team,

     

    I’m using the Javelin theme for a single-page website. I’ve set up section links in the main navigation menu so visitors can jump to sections on the homepage.

     

    The issue I’m having is that all the menu links appear to be active at the same time when I’m on the homepage. They all show their hover/active state together, instead of only the link for the current section.

     

    Is there a way to disable this behavior or fix it so only the correct link shows as active based on scroll position?

     

    Please let me know what you recommend.

     

     

    Thank you!

    randallrbaker
    Participant

    I went ahead and provided the login info so you can do in and take a look to see what’s going on.

    Shufflehound
    Moderator

    Hello,

     

    Thanks for providing access!

     

    We’ve added a small custom JavaScript snippet to help with the issue you described. It ensures that only the correct menu item stays active based on the current URL hash (e.g., #about, #contact) and prevents all menu links from showing as active at the same time:

    if (document.body.classList.contains('home')) {
    const currentHash = window.location.hash;
    document.querySelectorAll('li.menu-item.current-menu-item').forEach(function (item) {
    const link = item.querySelector('a');
    if (!link) return;
    
    const href = link.getAttribute('href');
    if (currentHash && href.endsWith(currentHash)) return;
    item.classList.remove('current_page_item');
    });
    }

     

    This script is already applied and should fix the visual conflict with the active menu items on the homepage.

     

    Let us know if you need further adjustments!

     

    Best regards,

    Shufflehound Team

    • This reply was modified 4 months, 4 weeks ago by Shufflehound.
    • This reply was modified 4 months, 4 weeks ago by Shufflehound.
Viewing 3 posts - 1 through 3 (of 3 total)

Popular choice

Professional Developers At Your Fingertips!

If you need services beyond standard support, we've got your back!

Services we offer:

Demo setup
Advanced customization
Layout adjustment
Graphic work / visualizations
Custom coding
Full WordPress development and design

Services

What we can offer

  • Demo setup +

    If you'd prefer not to handle the installation yourself or need help getting started, we'll set everything up for you.

  • Layout adjustment +

    We'll help you rearrange sections, adjust spacing, and modify the page structure to fit your needs.

  • Advanced customization +

    More complex styling changes, theme option modifications, and third-party integrations.

  • Custom coding +

    If you need something that's not included in the theme, we can code it for you.

  • Graphic work / visualizations +

    Web design services to create custom sections, pages, and blocks for your theme, plus graphics and visualizations.

  • Full WordPress development and design +

    Full website builds, custom theme development, or plugin creation from scratch.

  • About pricing +

    We'll provide a clear quote based on what you need. No hidden fees.

Professional Developers At Your Fingertips!

Custom Work Form