JavaScript控制鼠标滑轮事件

来源:岁月联盟 编辑:zhuzhu 时间:2008-08-06
<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="bannner.jpg" width="500" height="500">