gpt4 book ai didi

jquery - will_paginate + 无限滚动插件 - 不显示 "Loading"消息

转载 作者:行者123 更新时间:2023-12-01 06:02:33 26 4
gpt4 key购买 nike

我将 will_paginate gem 与 Infinite Scroll jQuery Plugin 结合使用而且这个机制运行得很好。唯一的异常(exception)是显示信息消息,当加载新内容或已经加载所有数据时 - 不会显示此消息。

这是我由 will_paginate gem 生成的分页结构:

<div class="pagination">
<span class="previous_page disabled">&#8592; Previous</span>
<em class="current">1</em>
<a rel="next" href="/articles?page=2">2</a>
<a href="/articles?page=3">3</a>
<a href="/articles?page=4">4</a>
<a class="next_page" rel="next" href="/articles?page=2">Next &#8594;</a>
</div>

这是无限滚动插件的设置:

  $container.infinitescroll({
navSelector : '.pagination', // selector for the paged navigation
nextSelector : '.pagination a', // selector for the NEXT link (to page 2)
itemSelector : '.box-item', // selector for all items you'll retrieve
loading: {
finishedMsg: 'No more pages to load.',
img: 'http://i.imgur.com/6RMhx.gif'
}
},

function( newElements ) {
var $newElems = $( newElements ).css({ opacity: 0 });
$newElems.imagesLoaded(function(){
$newElems.animate({ opacity: 1 });
$container.masonry( 'appended', $newElems, true );
});
}
);

一切都应该由手册页设置,但我不知道为什么,信息消息和加载程序没有加载......

感谢每一个帮助!

最佳答案

而不是

    nextSelector : '.pagination a',  // selector for the NEXT link (to page 2)

使用

    nextSelector : '.pagination a[rel="next"]', // selector for the NEXT link (to page 2)

这可能对你有帮助

关于jquery - will_paginate + 无限滚动插件 - 不显示 "Loading"消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9785672/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com