表格代码
{
field: "imgurl", title: "图片", templet: function (item) {
return '<img onclick="showimg(this)" id="driimg" style="display: inline-block; width: 50%; height: 100%;" src="'+item.imgurl+'">';
}
},
点击事件
function showimg(t) {
layer.open({
type: 1,
title: false,
closeBtn: 0,
area: '516px',
skin: 'layui-layer-nobg', //没有背景色
shadeClose: true,
content: '<img style="display: inline-block; width: 100%; height: 100%;" src="'+t.src+'">'
});
}