大佬教程收集整理的这篇文章主要介绍了jquery – 如何使用新的ajax内容进行无限滚动重置,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
var href = 'first'; $(document).ready(function() { $('#Boxes').infinitescroll({ navSELEctor: '.infinitescroll',nextSELEctor: '.infinitescroll a',itemSELEctor: '#Boxes .Box',loadingImg: '<?PHP echo geT_Bloginfo('stylesheet_directory') ?>/images/loading.gif',loadingText: 'Loading...',donetext: 'No more pages to load.',debug: false },function(arrayOfNewElems) { $('#Boxes').masonry('appended',$(arrayOfNewElems)); if(href != $('.infinitescroll a').attr('href')) { href = $('.infinitescroll a').attr('href'); } }); });
我在WordPress网站上使用Pual Irish infinite scroll plugin的最新版本2.0b2.120519.
$.ajax({ url: 'path/to/something.ext',success: function(data){ //call the method to destroy the current infinitescroll session. $('#Boxes').infinitescroll('destroy'); //insert the new data into the container from the_loop() call $('#Boxes').html(data); //reinstantiate the container $('#Boxes').infinitescroll({ state: { isDestroyed: false,isDone: false } }); //call the methods you need on the container again. $('#Boxes').infinitescroll({ navSELEctor: '.infinitescroll',function(arrayOfNewElems) { $('#Boxes').masonry('appended',$(arrayOfNewElems)); if(href != $('.infinitescroll a').attr('href')) { href = $('.infinitescroll a').attr('href'); } }); } });
以上是大佬教程为你收集整理的jquery – 如何使用新的ajax内容进行无限滚动重置全部内容,希望文章能够帮你解决jquery – 如何使用新的ajax内容进行无限滚动重置所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。