Created
July 23, 2016 03:59
-
-
Save jamilnyc/2126550267b00e085b04e27cc96aa6bc to your computer and use it in GitHub Desktop.
Configuring an Infinite Scroll Container with JScroll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Starting the scrolling script'); | |
$('.infinite-scroll').jscroll({ | |
debug: false, // Show debugging info in console | |
autoTrigger: true, // Start fetching without clicking a "next" link | |
autoTriggerUntil: false, // How many pages to auto trigger until requiring "next" click | |
loadingHtml: '<img src="/images/loading.gif" alt="Loading" />', // What to show when loading responses | |
padding: 20, | |
nextSelector: 'a.next-link:last', // The link with an href to the next response to load | |
callback: function () { | |
// Function called when the response is loaded | |
console.log('callback was called'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment