图片随着鼠标滑轮改变大小

来源:互联网 发布:自贸区政策 知乎 编辑:程序博客网 时间:2024/04/25 21:17

</STYLE>
<!-- / CSS Stylesheet -->
<SCRIPT language=javascript>
var count = 10;
function resizeimg(oImage)
{
count = Counting(count);
Resize(oImage,count);
return false;
}
function Counting(newzoom){
if (event.wheelDelta >= 120)
newzoom++;
else if (event.wheelDelta <= -120)
newzoom--;
if (newzoom<2) newzoom=2;
if (newzoom>50) newzoom=50;
return newzoom;
}
function Resize(oImage,newzoom){
oImage.style.zoom = newzoom + '0%';
count=newzoom;
}
</SCRIPT>

<SCRIPT type=text/javascript>
<!--
var SESSIONURL = "";
var IMGDIR_MISC = "images/misc";
// -->
</SCRIPT>

<DIV><IMG src="1.gif"><BR><IMG
      onmousewheel="return resizeimg(this)"
      ondblclick="return Resize(this,10);return false;"
      onclick="if(this.alt) window.open(/1.jpg');"
      alt=鼠标中键放大缩小,单击在新窗口察看 src="1jpg"
      onload="javascript:if(this.width>screen.width-333) this.width=screen.width-333"
      border=0> </DIV>

原创粉丝点击