layer.photos在父窗口打开

1.在父窗体里

  window.photosJSON = {
            "title": "", //相册标题
            "id": 123, //相册id
            "maxmin": true,
            "start": 0, //初始显示的图片序号,默认0
            "data": [   //相册包含的图片,数组格式

            ]
        }

2.子窗体调用

 $("#imglst").on("click", 'img', function () {
        var _this = $(this);
        top.photosJSON.data = [];
        var index = _this.parent().index();
        top.photosJSON.start = index;
        $("#imglst").find("img").each(function () {
            top.photosJSON.data.push({ "src": $(this).attr("layer-src"), "pid": 0, "thumb": "", "alt": "" });
        })
        top.layer.photos({
            photos: top.photosJSON
        })
    })

  

上一篇:swift photos自定义多选图片,有编号,自定义裁切


下一篇:Windows10下photos不能打开或是没反应