js控制图片放大缩小的简易版

js代码:

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

图片html标签:

<img onmousedown="if(self.startMove)startMove(this,event)" onmousewheel="return bb_img_onmousewheel(event,this)" style="cursor: move; zoom: 80%;" src="" width="600px" />
原文地址:https://www.cnblogs.com/blazeZzz/p/7698824.html