html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,maximum-scale=1.0,user-scalable=no">
<title></title>
<style>
body, ul, li, section, div {
padding: 0;
margin: 0;
}
body {
font-family: Arial, Roboto, 'Droid Sans', 'Hiragino Sans GB', STXihei, 'sans-serif';
width: 100%;
-webkit-user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-text-size-adjust: none;
}
ul, li {
list-style: none;
}
img {
border: 0;
}
/*弹框样式*/
.imgzoom_pack {
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
background: transparent;
/* background: rgba(0, 0, 0, .7); */
display: none;
}
.imgzoom_pack .imgzoom_img {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
overflow: hidden;
background: black;
}
.imgzoom_pack .imgzoom_img img {
width: 100%;
position: absolute;
top: 50%;
}
.informBlock {
margin: 0 11% 22px;
width: 78%;
text-align: center;
}
.informBlock img {
margin-bottom: 5px;
max-height: 250px;
max-width: 100%;
border-radius: 2%;
}
</style>
</head>
<body>
<div class='informBlock'>
<img class="image_click" src="./微信图片_20230218153921.png"/>
</div>
<section class="imgzoom_pack">
<div class="imgzoom_x">
<div class="imgzoom_img"><img src="./微信图片_20230218153921.png"/></div>
</div>
</section>
<script src="./fangda.js"></script>
<script type="text/javascript">
ImagesZoom.init({
"elem": ".informBlock"
});
</script>
</body>
</html>
fangda.js
(function(window, undefined){
var document = window.document,
support = {
transform3d: ("WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix()),
touch: ("ontouchstart" in window)
};
function getTranslate(x, y){
var distX = x, distY = y;
return support.transform3d ? "