html部分
<img src="图片地址" onclick="showImg('名称','图片地址')" style="height: 30px;cursor: pointer;">
js部分
<script>
function showImg(name, url) {
layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: true,
area: ['300px'],
content: "<img alt=" + name + " title=" + name + " src=" + url + " style='width:300px;' />"
});
}
</script>