Rectangle 27 0

The position of the scrollbar is saved to localstorage, then when the page loads again, either by refresh or back from another page, if localstorage has a value greater than 0 which represents the top of the scrollbar (default, unscrolled position), it scrolls to that position.

var element = $(".scroll-pane").jScrollPane({showArrows:true});
if(element != undefined) {
  var api = element.data("jsp");
  $(function() {
    if(parseInt(localStorage.getItem("ScrollPosition")) > 0) {
      api.scrollToY(parseInt(localStorage.getItem("ScrollPosition")))
    }
    $(".scroll-pane").bind("jsp-scroll-y", function(event, scrollPositionY, isAtTop, isAtBottom) {
      localStorage.setItem("ScrollPosition", scrollPositionY)
    }).jScrollPane()
  })
}
;

javascript - jScrollPane how to store scroll position? - Stack Overflo...

javascript jquery jscrollpane