I'm using scrollsaver.js (http://en.hasheminezhad.com/scrollsaver) to maintain scroll positions of elements on postback. There are instances where I wish to reset scroll position though, and I am having trouble doing so.
Paging through a list, I wish to scroll to the top on each page change. I do this by registering a call to resetGridScroll (below) in the paging handler.
scrollsaver.js ties to the page load event. When I do the same, my function runs before scrollsaver.js loads positions. Is there a way to force mine to run after page load?
function resetGridScroll() {
$(document).ready(function () {
$("div.items").animate({ scrollTop: 0, easing: 'swing', queue: false }, 15000);
});
}
EDIT: I ended up clearing the cookie scrollsaver.js sets to store scroll positions. It gets cleared before the script loads so all positions are reset. Not elegant, but workable.