按照有关无限滚动的说明,我能够从第2、3、4页等中隐藏新内容,直到完成加载然后进行动画处理。现在,我想达到相同的效果,但主要内容是首页。有什么帮助吗?我正在使用的代码:
<script>
$(function(){
var $container = $('#boxes');
$container.imagesLoaded( function(){
$container.isotope({
itemSelector : '.box'
});
});
</script>
<script>
$('#boxes').isotope({
// options
itemSelector : '.box',
layoutMode : 'masonry'
masonry : {
columnWidth : 325
},
});
</script>
<script>
$(function(){
var $container = $('#boxes');
$container.imagesLoaded(function(){
$container.isotope({
itemSelector: '.box'
});
});
$container.infinitescroll({
navSelector : '#navigation',
nextSelector : '#navigation a#next',
itemSelector : '.box',
loading: {
finishedMsg: 'no more pages to load.',
img: 'http://i.imgur.com/qkKy8.gif'
}
},
function(newElements){
var $newElems = jQuery( newElements ).hide()
console.log('Elements …Run Code Online (Sandbox Code Playgroud)