当前位置: 代码迷 >> 综合 >> layui中layer.photo动态添加的图片,每次弹出上一张添加的图
  详细解决方案

layui中layer.photo动态添加的图片,每次弹出上一张添加的图

热度:43   发布时间:2024-01-16 22:42:13.0

layui版本:2.5以上

修改layer.js源码,注意h(); 调用位置

 修改前:

if (n || p.on("click", t.img,
function() {var e = i(this),n = e.attr("layer-index");r.photos(i.extend(t, {photos: {start: n,data: u,tab: t.tab},full: t.full}), !0)h();
}), !n) return

修改后:

if (n || p.on("click", t.img,
function() {h();var e = i(this),n = e.attr("layer-index");r.photos(i.extend(t, {photos: {start: n,data: u,tab: t.tab},full: t.full}), !0)
}), !n) return

 

  相关解决方案