Created
September 18, 2014 18:49
-
-
Save kmgdevelopment/ae40b144adc0d6c2ee94 to your computer and use it in GitHub Desktop.
Ajax Infinite Scroll + Masonry
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
var container = document.querySelector('.container'); | |
var msnry = new Masonry( container, { | |
// options | |
itemSelector: '.item', | |
gutter: 10 | |
}); | |
var ias = $.ias({ | |
container: ".container", | |
item: ".item", | |
pagination: "#pagination", | |
next: ".next a", | |
delay: 1200 | |
}); | |
ias.on('render', function(items) { | |
$(items).css({ opacity: 0 }); | |
}); | |
ias.on('rendered', function(items) { | |
msnry.appended(items); | |
}); | |
ias.extension(new IASSpinnerExtension()); | |
ias.extension(new IASNoneLeftExtension({html: '<div class="ias-noneleft" style="text-align:center"><p><em>You reached the end!</em></p></div>'})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment