active menu item in a horizontal scrolling navbar in view on mobile? When I select the menu link on the far right, it will load with the link off screen since the navbar is left justified. I'm pretty sure someone gave me css for this in the past but I can't find it.

changelog

Live Example

[own_shortcode1]

JavaScript

document.addEventListener('DOMContentLoaded', () => {
const nav = document.querySelector('.ts-nav-menu');
if (!nav) return;
const activeItem = nav.querySelector('.current-menu-item');
if (!activeItem) return;
activeItem.scrollIntoView({
block: 'nearest',
behavior: 'smooth'
});
});

Horizontal scrolling navbar in view on mobile

The Mission

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

There are no results matching your search

AI Assistant