I use jQuery masonry and now add an infinite scroll. There are images in almost every brickwork, and before I used infinite scrolling, the images loaded well, and everything was great. I added the next part of javascript for endless scrolling and added the imageLoaded method inside, but when new bricks are added, they go out to all the ones built on top. My guess is that I am not adding the imagesLoaded method properly in the infinite scroll callback, but I could not find my error. Here is the code
<script type="text/javascript"> $(function(){ var $container = $('#container'); $container.imagesLoaded(function(){ $container.masonry({ itemSelector : '.tile', columnWidth : 240 }); }); var $container = $('#container'); $container.infinitescroll({ navSelector : ".flickr_pagination", </script>
The first jQuery masonry call worked fine and was not affected. This is the second part where the problem seems to be. Thanks for the help and let me know if you need more information.
image infinite-scroll jquery-masonry loaded
wuliwong
source share