Hi,
Using a footer nav bar menu with content scrolling links running off to the right of the canvas. Clicking on a nav bar link, the page reload will return the nav scroll bar position to the far left. Is it possible to retain the scroll bar position between page reloads?
I can see in the console that the style in div class=“ps-scrollbar-y-rail” style=“top: 0px; right: -xxxxpx;” changes as the nav bar is scrolled to the right but I’m new to JS - hope you can help.
[edit] After a lot of googling I’ve started with this code in the footer JS - thought it might be possible to replace the style settings for that div element on a page reload / new page (no idea what the correct hook is or if this approach would even work) but right now, sessionStorage returns undefined.
jQuery ( document ).ready ( function($) {
var vScrollPos = jQuery("#ps-scrollbar-y-rail").css("right");
if ( vScrollPos == '' || vScrollPos == '#' || vScrollPos == undefined ) return false;
sessionStorage.scrollLeft = jQuery(vScrollPos);
});
I’ll send the WP URL and admin access in a secure note, thanks in advance