图片预览问题修改
This commit is contained in:
parent
c9d58da3af
commit
8304c056b4
Binary file not shown.
|
After Width: | Height: | Size: 266 B |
Binary file not shown.
|
After Width: | Height: | Size: 323 B |
|
|
@ -3,6 +3,7 @@ function viewImg(item) {
|
|||
layer.photos({
|
||||
shade: 0.5,
|
||||
footer: false,
|
||||
// toolbar: ['prev', 'next', 'download', 'customBtn'], // 添加自定义按钮标识
|
||||
photos: {
|
||||
"title": "图片预览",
|
||||
"start": 0,
|
||||
|
|
@ -13,6 +14,26 @@ function viewImg(item) {
|
|||
}
|
||||
]
|
||||
},
|
||||
success: function(layero){
|
||||
// 获取工具栏元素
|
||||
var toolbar = $(layero).find('.layui-layer-photos-toolbar');
|
||||
// 添加自定义按钮
|
||||
var customBtn = $('<div class="layui-layer-photos-btn layui-layer-photos-customBtn" title="原图下载">'+
|
||||
'<img style="margin-top: 15px;cursor: pointer;" src="../../img/synthesisQuery/download_icon2.png"></div>');
|
||||
toolbar.append(customBtn);
|
||||
// 绑定点击事件
|
||||
customBtn.on('click', function(){
|
||||
imgDownLoad(item,1);
|
||||
});
|
||||
|
||||
var customBtn2 = $('<div class="layui-layer-photos-btn layui-layer-photos-customBtn" title="水印下载">'+
|
||||
'<img style="margin-top: 15px;cursor: pointer;" src="../../img/synthesisQuery/water_icon.png"></div>');
|
||||
toolbar.append(customBtn2);
|
||||
// 绑定点击事件
|
||||
customBtn2.on('click', function(){
|
||||
generateWatermark(item)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue