编写jquery 1.8脚本来使用jquery 3.x

Make a jquery 1.8 script to use jquery 3.x

本文关键字:jquery 本来 8脚 编写      更新时间:2023-09-26

我有一个脚本无限滚动,这是建立与jquery 1.8.3,但它不工作的网站是使用jquery 3.1.1,我需要这个脚本开始使用3.1.1,因为我的网站引导模式使用3.1.1,我不能放弃3.1.1。这是app

    $(document).ready(function(){
    $('#content').infinitescroll({
        navSelector: "#next:last",
        nextSelector: "#next:last",
        itemSelector: "#content",
        debug: false,
        dataType: 'html',
    maxPage: 6,
        path: function(index) {
            return "index" + index + ".html";
        }
        // appendCallback   : false, // USE FOR PREPENDING
    }, function(newElements, data, url){
      // used for prepending data
        // $(newElements).css('background-color','#ffef00');
        // $(this).prepend(newElements);
    });
});

和js类位于这里http://www.hongkiat.com/blog/infinite-page-scroll/

Jquery no-conflict()已经解决了这个问题