【发布时间】:2014-10-09 13:50:30
【问题描述】:
我知道有几个关于 is 的问题,都检查了,但由于我不明白如何开始,所以无法让它工作......
我有基本的砌体设置:
现在如何设置首先显示多少个元素以及如何触发以无限 scoll 开始加载下一个元素?请帮忙
我发现了很多这样的:
jQuery(window).load(function(){
jQuery('.hfeed').masonry({
singleMode: true,
itemSelector: '.box'
});
jQuery('.hfeed').infinitescroll({
navSelector : '.pagination', // selector for the paged navigation
nextSelector : '.pagination .next', // selector for the NEXT link (to page 2)
itemSelector : '.box', // selector for all items you'll retrieve
loadingImg : '/wp-content/themes/sprppl/images/loader.gif',
loadingText : "Loading...",
donetext : 'No more pages to load.',
debug: false,
errorCallback: function() { jQuery('#infscr-loading').animate({opacity: .8},2000).fadeOut('normal'); }
},
// call masonry as a callback
function( newElements ) { jQuery(this).masonry({ appendedContent: jQuery( newElements ) }); }
);
});
但是当我插入它时,什么也没有发生。如何从这里开始?
【问题讨论】:
-
您的 jsfiddle 不起作用,因为您的 javascripts 链接链接到网页,而不是脚本。你从来没有加载 imagesloaded.js 并且在它之上你的 imagesloaded 函数也不正确。这是一个更正的小提琴,可以看到它实际工作(尚未添加无限滚动)Masonry example
标签: javascript jquery html jquery-masonry infinite-scroll