首页 > 代码库 > js issue

js issue

1 iscroll 5 和 lazyload 同时使用  转自 yinjie

//lazyload
var $scrollEle = $("#wrapper")
$("img.lazy").lazyload({
     effect: ‘fadeIn‘,
     container: $scrollEle
});

//iscroll
var myscroll = new IScroll(‘#wrapper‘, {  //最外层的盒子
    mouseWheel: false,
    click: true,
    preventDefault: false,
    usetransform: false
});
document.addEventListener(‘touchmove‘, function (e) { e.preventDefault(); }, false);
myscroll.on(‘scrollEnd‘, function () {
    $scrollEle.trigger(‘scroll‘);
}

 

js issue