Documentation
Online documentation for Ajax Load More
Public Functions
The following public functions allow for manipulation of Ajax Load More instances.
Click
almTriggerClick() – function will allow you trigger Ajax Load More from any element on the screen.
1 2 3 4 5 6 7 |
$(function() { $('#my_button').click(function(){ $.fn.almTriggerClick(); }); })(jQuery); |
Note: almTriggerClick should only be called when a single instance of Ajax Load More is on the page.
Filtering
almFilter(transition, speed, data) – function will allow you to update Ajax Load More parameters on the fly and provide a clean transition between each filter – view the example
almFilter() requires the following three parameters:
transition | Select a transition type. ‘fade’ | null |
---|---|
speed | The speed of the transition, in milliseconds. e.g. ‘300’ |
data | The data() object that holds the parameters for updating. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
$(function() { /* Example HTML Markup <ul> <li> <a href="#" data-button-label="More Work" data-post-type="portfolio">Recent Work</a> </li> <li> <a href="#" data-button-label="More Posts" data-post-type="post">Latest Posts</a> </li> </ul> */ $('li a').on('click', function(){ var el = $(this); var data = el.data(); // Get data values of selected item $.fn.almFilter('fade', '300', data); }); })(jQuery); |
e.g. button_label = button-label