jquery-endless-scroll
jquery-endless-scroll copied to clipboard
how to destroy/recreate endless scroll.
how we can destroy/recreate endless scroll at certain activity/condition in the page with resetting everything like fireSequence /pageSequence along with attributes.
EndlessScroll listens the scroll event and executes a function periodically, so you just need to remove the binding and clear the interval.
The constructor returns the pointer to the interval.
var interval;
// Destroy EndlessScroll
if (interval) {
clearInterval(interval);
$('#element').unbind('scroll');
}
interval = $('#element').endlessScroll();