Skip to content

Commit

Permalink
demos : inf scroll : hide/show new items
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Oct 7, 2011
1 parent 11426d6 commit 850c505
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion _posts/demos/2011-05-09-infinite-scroll.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,12 @@ <h2>Fusce accumsan mollis eros. Pellentesque a diam sit amet mi ullamcorper vehi
},
// trigger Masonry as a callback
function( newElements ) {
var $newElems = $( newElements );
// hide new items while they are loading
var $newElems = $( newElements ).css({ opacity: 0 });
// ensure that images load before adding to masonry layout
$newElems.imagesLoaded(function(){
// show elems now they're ready
$newElems.animate({ opacity: 1 });
$container.masonry( 'appended', $newElems, true );
});
}
Expand Down

0 comments on commit 850c505

Please sign in to comment.