日期:2014-05-17 浏览次数:20672 次
调用infinitescroll插件: <script> $(function(){ var $container = $('#container'); $container.imagesLoaded(function(){ $container.masonry({ itemSelector: '.box', columnWidth: 100 }); }); $container.infinitescroll({ navSelector : '#page-nav', // selector for the paged navigation nextSelector : '#page-nav a', // selector for the NEXT link (to page 2) itemSelector : '.box', // selector for all items you'll retrieve loading: { finishedMsg: 'No more pages to load.', img: 'http://i.imgur.com/6RMhx.gif' } }, // trigger Masonry as a callback function( 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 ); }); } ); }); </script>
------解决方案--------------------
http://blog.sina.com.cn/s/blog_9fb00b0b01013agu.html
我的笔记 ,就是你要的效果,代码都在上面