Press "Enter" to skip to content

上传图 预览图片

function showThis(imgdom)
{
    let theWidth = $(this).width();
    let theHeight = $(this).height();

    // 图片的src
    var modulus = theWidth/theHeight ;

    var widthNew = theWidth * 0.6;
    var heightNew = widthNew / modulus;

    heightNew += 'px';
    widthNew += 'px';

    //拷贝元素
     
    var str_imgdom = imgdom.outerHTML;
    layer.open({
        type: 1,
        skin: 'layui-layer-rim', //加上边框
        shadeClose: true, //开启遮罩关闭
        area:[widthNew, heightNew],
        content: str_imgdom,
    });
}
发表评论