Jquery WEUI 滚动加载(infinite)不触发

原代码

//jquery-weui-min.js
t.prototype.scroll=function(){var t=this.container,n=t.scrollHeight()-(e(window).height()+t.scrollTop());n<=this.distance&&t.trigger("infinite")},

  

修改

  t.prototype.scroll = function() {
        var container = this.container;
        var tagName = container[0].tagName.toUpperCase()
        var scrollTop
        if (tagName === ‘BODY‘ || tagName === ‘HTML‘) {
            scrollTop = container.scrollTop() || $(window).scrollTop()
        } else {
            scrollTop = container.scrollTop()
        }
        var offset = container.scrollHeight() - ($(window).height() + scrollTop);
        if(offset <= this.distance) {
            container.trigger("infinite");
        }
    },

 

页面js

$(document.body).infinite().on("infinite", function () {
   //  ...

})

  

解决

 

博客转自 https://www.cnblogs.com/mr-shb/p/11584235.html

 

Jquery WEUI 滚动加载(infinite)不触发

上一篇:php ZipArchive 使用问题记录


下一篇:(function($){})(jQuery)