通过Javascript代码来使用鼠标的中键


第一步:把下列代码放到<head>.........</head>中

 

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

 

  第二步:把下列代码放到<body>......</body>中:

 

<a onfocus=this.blur() href=" ";  border=0  onmousewheel="return bbimg(this)" onload="javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;"></a>

 

  本人测试时使用的是IE6.0,其他的浏览器不知道支持不?大家可以自己去测试一下

 

本文作者:
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3