利用鼠标滚轮控制图片自动缩放的子程序

<SCRIPT language=JavaScript type=text/JavaScript>

function img_zoom(e, o)    //图片鼠标滚轮缩放

{
  var zoom = parseInt(o.style.zoom, 10) || 100;
  zoom += event.wheelDelta / 12;
  if (zoom > 0) o.style.zoom = zoom + '%';
  return false;
}

</SCRIPT>
<img alt="鼠标的滚轮控制图片自动缩放" onload="javascript:if(this.width>screen.width-500)this.width=screen.width-500" onmousewheel="return img_zoom(event,this)" src="" />
 

文章分类: