layer.photos()异步修改图片地址后显示异常

项目中有一个图片有预览(用的layer.photos()),需要异步修改图片地址,但是成功修改后第一次预览会显示修改前的大图,第二次以后就都正常了。

尝试修改成功后再次调用layer.photos(),也没有作用。

把layer.js文件中

loop || parent.on('click', options.img, function(){
       
      var othis = $(this), index = othis.attr('layer-index'); 
      layer.photos($.extend(options, {
        photos: {
          start: index,
          data: data,
          tab: options.tab
        },
        full: options.full
      }), true);
 pushData();
})

改为


loop || parent.on('click', options.img, function(){
pushData();
var othis = $(this), index = othis.attr('layer-index');
layer.photos($.extend(options, {
photos: {
start: index,
data: data,
tab: options.tab
},
full: options.full                                                                                  
}), true);

})
posted @ 2018-02-26 17:27  Jade_g  阅读(518)  评论(0编辑  收藏  举报