layui 列表图片点击放大显示

  {title: "展示图", templet: "#pic",align: "center", width: width * 0.05},
        $(document).on('click', '#myImg', function(data){
            var image=new Image();
            image.src=data.currentTarget.src;
            var h = image.height;
            var w = image.width;
            var v = Wh(w,h);
            w=v[0];
            h=v[1];
            layer.open({
                closeBtn:0,
                shift:3,
                shadeClose : true, // 点击遮罩关闭层
                area : [ w+"px", h+"px" ],
                type: 1,
                title:false,
                offset: v[2]+'px',
                content: "" //注意,如果str是object,那么需要字符拼接。
            }, ($(this)), {open: [2, '#5CBA59'], time: 0});
        });
use(["layer", "form", "table", "jquery", "laydate", "upload"], function () {
        var $ = layui.jquery;
        var e = layui.$, t = layui.layer, i = layui.form, l = layui.table;
        var width = $(document).width();
        var height = $(document).height();

 

你可能感兴趣的:(layui 列表图片点击放大显示)