18910140161

H5实现微信图片点击放大效果

顺晟科技

2021-06-16 11:00:32

566

函数整体(url) {

var Image=new Image();

image.src=url

var screenH=$(窗口)。高度(),

screenW=$(窗口)。width(),

屏幕百分比=数学。地板((屏幕宽度/屏幕高度)* 100)/100,

w,h,左,上;

image.onload=function () {

var imgH=image.height,

imgW=image.width,

IMGPercent=数学。楼层((IMGW/IMGH)* 100)/100,

imgWs=screenW,

//IMGhs=IMGh/IMGpercent;

//IMGhs=IMGh/IMGpercent;

IMGHs=数学。楼层((IMGWs/IMGPercent)* 100)/100;

if (imgW screenW) {

w=imgW

h=imgHs

top=(screenH-h)/2;

} else {

w=imgWs

h=imgHs

top=数学。楼层(((screenH-h)/2)* 100)/100;

}

排名前0?top=0 : top=top

$('#bigimg ').css({

top: top

}).attr('src ',URL);

$('.整体')。show();

}

}

//调用:WhILIMG(URL);

相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航