jquery-paged-scroll
jquery-paged-scroll copied to clipboard
reset page scroll without page refresh?
Is there a way to destroy an instance of the page scroll and create a new one without the page being refreshed? I am using the page scroll on a container that gets updated via ajax. When it gets updated i need the page scroll to refresh itself and start over. I've tried calling the function a second time but that just creates two instances of itself. http://www.warehouseskateboards.com/skateboard-completes is an example of a page i want to scroll. When you select a filter in the left nav you can see how the container on the right "refreshes". That is when i need the page scroll to also refresh. Any help would be greatly appreciated.
Initialize the Code when you want to reset the page numbering like create a method, Put the code inside it and call that method ex:-
self.pageScrollData = function(){
$('#patientWL').paged_scroll({
handleScroll: function(page, container, doneCallback) {
$.ajax("/URLTOFETCHDATA" + f_PagesNO ").done(function(data) {
// dO YOUR tHINGS
// doneCallback(page, container);
},
triggerFromBottom: '1%',
loading: {
html: '<div class="paged-scroll-loading"><img alt="Loading..." src = "assets/images/loading_data.gif" /></div>'
},
pagesToScroll: totalpages,
debug:true,
targetElement: $('#patientWL')
});
}