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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM