位置:海鸟网 > IT > JavaScript >

JavaScript控制鼠标滑轮事件

<script language="JavaScript">
<!--
//document.body.onmousewheel = function(){alert('你在滚,哈哈');}

function img_zoom(e, o){ //图片鼠标滚轮缩放
   var zoom = parseInt(o.style.zoom, 10) || 100;
   zoom += event.wheelDelta / 24;
   if (zoom >0) o.style.zoom = zoom + '%';
   return false;
}
//-->
</script>
<img onmousewheel="return img_zoom(event,this)" src=http://www.jz123.cn/text/"bannner.jpg" width="500" height="500">