Hi there,
I have a problem when the page has finished loading, that the page scrolls to the top away from where the user is viewing content in a drop-list close to the bottom of the page.
I do not want the page to scroll to the top of the page. Or Alternatively, I would like the page to scroll to the position (component) where the use was once the page has loaded.
I have tried the following:
1) On click to open the drop-list, I try to set the location using:
var scrollPosition = $(Tour_Drop).scrollTop;
localStorage.setItem("ScrollTo", scrollPosition);
This appears to work as a position of the Tour-Drop is saved.
2) Then on the page load event, I try to get the page to move to the location saved to storage using:
var scrollPosition = localStorage.getItem("ScrollTo");
$(window).scrollTop(scrollPosition);
I have also tried using window.scrollBy(0,scrollPosition);
Unfortunately nothing happens.
Your help would be greatly appreciated.
thanks
Jimmy