需要在表格里面添加查看图片的模板
<div style="width: 400px;height: 200px" onclick="showLarge('../images/lidong.jpg')">
<img height="100%" width="100%" src="../images/lidong.jpg" alt="">
</div>
放大的function
<script type="text/javascript" >
//查看大图
function showLarge(src) {
layer.photos({
photos: {
"title": "", //相册标题
"id": 123, //相册id
"start": 0, //初始显示的图片序号,默认0
"data": [ //相册包含的图片,数组格式
{
"alt": "图片名",
"pid": 666, //图片id
"src": src, //原图地址
"thumb": "" //缩略图地址
},
{
"alt": "图片名",
"pid": 555, //图片id
"src": '../images/lidong.jpg', //原图地址
"thumb": "" //缩略图地址
}
]
}
,anim: 0 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
})
}
</script>