<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="zoom/zoomify.min.css">
<title>Document</title>
<style>
*{
margin: 0;
}
body{
overflow: hidden;
}
img{
width: 300px;
height: 300px;
}
</style>
</head>
<body>
<img id="oImage" src="WechatIMG11.jpg" onmousewheel=" return picture()" style="cursor:pointer" />
<script>
var count = 10;
function picture(){
count = Counting(count);
Resize(count);
}
function Counting(count){
if(event.wheelDelta>=120){
count++;
}else if(event.wheelDelta<=-120){
count--;
}
return count;
}
function Resize(count){
oImage.style.zoom = count+'0%';
// oCounter.innerText = count+'0%';
}
</script>
</body>
</html>
滚轮控制缩放
最新推荐文章于 2024-03-13 15:25:43 发布