天天看點

js滑鼠滾輪放大縮小圖檔

function bigimg(obj){

var zoom = parseInt(obj.style.zoom,10)||100;

zoom += event.wheelDelta / 12;

if(zoom > 0 )

obj.style.zoom=zoom+'%';

return false;

}

使用方法

<img id="chgImg" src="'你的圖檔位址'" width="760" onmousewheel="return bigimg(this)" style="cursor:pointer" />