Features
- No dependencies
- Endless scrolling - scroll to the bottom of the content to load next.
- Endless click - Like endless scroll but click a link to load the next pages.
- Falls back gracefully when JavaScript is not available.
- We mostly use it on Shopify but it can work on any site.
Getting Started
Add ajaxinate.min.js to the assets folder of your shopify theme, or add it to your vendor files if you are using slate.
Add ajaxinate.min.js before the closing body tag or defer it’s loading.
Setup your collection or blog template, for example:
Initialize it in your script file or inline
Settings
If you wish to change the names of the selectors you can pass them in with the following settings.
For example:
Option | Default | Type | Description |
---|---|---|---|
pagination | #AjaxinatePagination |
String | A selector to identify the pagination container. |
container | #AjaxinateLoop |
String | A selector to identify the grid that you want to duplicate. |
method | scroll |
String | Can be changed to click to that users must click to load more. |
offset | 0 |
Integer | Decrease the distance required to scroll before sending a request. |
loadingText | Loading |
String | Change the text of the pagination link during a request. |
callback | null |
Function | A function fired after the new page has been loaded. |
Methods
.destroy()
Description: Stop Ajaxinate from running and unbind the event listeners