在基于bootstrapTable动态加载表格为图片时,实现图片双击放大显示预览
$("#theTable").on('dblclick', "img[name='show_Photo']",function() {
$('#bigPhoto>img').prop('src', $(this).prop('src'));
$('#bigPhoto>img').css({
//height : '480px',
width : '800px'
});
if ($(this).prop('src') == null || $(this).prop('src') == '')
return;
layer.open({
type : 1,
title : false,
closeBtn : 0,
area : [ '800px', '' ],
skin : 'layui-layer-nobg', //没有背景色
shadeClose : true,
content : $('#bigPhoto')
});
});
需放大图片位置
注:
layer.open({
type : 1,
title : false,
closeBtn : 0,
area : [ '800px', '' ],
skin : 'layui-layer-nobg', //没有背景色
shadeClose : true,
content : $('#bigPhoto')
});
这段代码需要layer的依赖