hugo-book
hugo-book copied to clipboard
Feature request: scroll active menu item into view
Hugo-book is a great theme, thanks for your hard-working @alex-shpak. Could you do me a favor. I want to make the active menu item auto scroll into view. I am not a programmer and I am not good at programming. After google, I got these script.
function scroll(){
let e = document.querySelector( '.book-menu a.active' );
e.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'start' })
}
setTimeout(scroll, 0);
It worked, but it created more problem.
I like your no jquery idea, in my opinion javascript is convenient for developers but not for visitors, less javascript is more. I think this can be a useful feature. can you improve it?