Skip to content

Instantly share code, notes, and snippets.

@kmgdevelopment
Created September 18, 2014 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmgdevelopment/ae40b144adc0d6c2ee94 to your computer and use it in GitHub Desktop.
Save kmgdevelopment/ae40b144adc0d6c2ee94 to your computer and use it in GitHub Desktop.
Ajax Infinite Scroll + Masonry
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