JS 图片缩放效果代码
时间:2020-11-03 13:43:09|栏目:JavaScript代码|点击: 次
复制代码 代码如下:
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>onMouseWheel</TITLE>
<SCRIPT>
var count = 10;
function Picture()
{
count = Counting(count);
Resize(count);
return false;
}
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>
</HEAD>
<BODY>
<div align=center>
<span style="font-weight:bold">Size =
<span id="oCounter" style="color:red;">100%</span></span>
<img id="oImage" src="images/aaa.gif" onmousewheel="return Picture();" >
</div>
</BODY>
</HTML>
上一篇:gulp-htmlmin压缩html的gulp插件实例代码
栏 目:JavaScript代码
下一篇:canvas 绘制圆形时钟
本文标题:JS 图片缩放效果代码
本文地址:http://www.codeinn.net/misctech/18783.html