利用onmousewheel事件控制圖像大小

来源:互联网 发布:影视金器软件下载 编辑:程序博客网 时间:2024/04/29 20:50

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

<img src="" onmousewheel="return bbimg(this)">

原创粉丝点击