$('#demo1').click(function(){
var src = $(this).attr('src');
var imgHtml = "<img src='" + src + "' width='500px' height='500px'/>";
//弹出层
layer.open({
type: 1,
shade: 0.8,
offset: 'auto',
area: [500 + 'px',550+'px'],
shadeClose:true,
scrollbar: false,
title: "图片预览", //标题
content: imgHtml, //图片的元素
cancel: function () {
//layer.msg('success', { time: 5000, icon: 6 });
}
});
})
Layui图片弹框预览
于 2023-04-12 10:17:56 首次发布