Load More
Adds AJAX support to long, paginated lists as a replacement for standard URL-based pagination.
This assumes you have an existing back-end pagination approach, such as WordPress' built-in pagination.
Usage
Item #1 Item #2 Item #3 Item #4 Item #5 Item #6 Next Page Load More
var LoadMore = ; container: '[data-load-more]' button: '[data-load-more-button]' link: 'a.next-page' remove: '.pagination, .load-more';
Options
container
Type: String
Default: [data-load-more]
Selector for the element containing the list to be paginated.
button
Type: String
Default: [data-load-more-button]
Selector for the load more button element. Should be present in the load-more container on all pages except the last one.
link
Type: String
Default: [data-load-more-link]
Selector for the anchor element to the next page. This element's href will be used to fetch the next page using AJAX.
remove
Type: String
Default: Values of link
and button
, e.g. [data-load-more-link], [data-load-more-button]
Selector for elements within the load more container that should be removed before adding new content (e.g. pagination & load more controls for the previous page).
callback
Type: Function
Default: null
Callback function to execute after the load more action has completed.