1.0.3 • Published 8 years ago

yohoho.yofinity v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Yofinity Build Status

an infinite scroll jQuery plugin
npm version GitHub version

Demo page

Package manager

//bower
bower install --save yohoho.yofinity
//npm
npm install yohoho.yofinity

Install

<!-- In your <body> HTML tag -->

<a href="http://example.com/page/2" title="Next posts" rel="next">Loading...</a>
//in your main JS file
$('body').yofinity({
    buffer: 1000,
    navSelector: 'a[rel="next"]',
    success: function ($link, response){
        $link.before(response);
        $link.attr('href', '/page/2');
    },
    error: function ($link){
        $link.remove();
    }
});

Settings

OptionTypeDefaultDescription
bufferinteger1000Number of pixels to fire infinite scroll BEFORE the node element
contextobjectwindow-
debugbooleanfalseEnables the debug tools when it's needed
errorfunctionnullFunction called if script fires an error
loadingfunctionnullFunction called when script fires loading
navSelectorstring'arel="next"'Define node element containing AJAX request through the href attribute
successfunctionnullFunction called when script fires success

Dependencies

jQuery 2.1.4

Authors and Copyright

Made with ♥ by Achraf Chouk

Please, read LICENSE for more details.