首页 > 其他 > 详细

img查看大图时图片变形

时间:2019-09-29 16:25:55      阅读:105      评论:0      收藏:0      [点我收藏+]

layui.use(‘layer‘, function () {
var layer = layui.layer;
var img = new Image();
img.src = imgUrl;
var content = ‘<div style="text-align:center;overflow: hidden;width:‘ + img.width + ‘px;height:‘ + img.height+ ‘px"><img style="max-width:100%;max-height:100%;left:0;top:0;right:0;bottom:0;margin:auto" src="‘ + imgUrl + ‘"/></div>‘;

layer.open({
title: false,
type: 1,
offset: ‘auto‘,
btn: false,
closeBtn: false,
area: [w + ‘px‘, h + ‘px‘],
content: content,
success: function (e, i) {
e.dblclick(function () {
layer.close(i);
});
}
});
});

img查看大图时图片变形

原文:https://www.cnblogs.com/yyjspace/p/11607682.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!