Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
I've put a little script on some pages so that, if the visitor leaves the page, then returns, his original scroll position is retained:
function retainPos() {
var pathName = document.location.pathname;
window.onbeforeunload = function () {
var scrollPosition = $(document).scrollTop();
sessionStorage.setItem("scrollPosition_" + pathName, scrollPosition.toString());
}
if (sessionStorage["scrollPosition_" + pathName]) {
$(document).scrollTop(sessionStorage.getItem("scrollPosition_" + pathName));
}
};
$(document).ready(retainPos);
Works just fine on a simple page of thumbnails. But if I use Justified-Gallery, it no longer works. I can't figure out what JG is doing that interferes with this simple mechanism.
I've put a little script on some pages so that, if the visitor leaves the page, then returns, his original scroll position is retained:
Works just fine on a simple page of thumbnails. But if I use Justified-Gallery, it no longer works. I can't figure out what JG is doing that interferes with this simple mechanism.
Can anyone suggest where I should be looking?