鼠标滚轮改变图片大小的示例代码

(编辑:jimmy 日期: 2024/10/14 浏览:2)

鼠标滚轮改变图片大小的示例代码
<script>
function onWheelZoom(obj){
        zoom = parseFloat(obj.style.zoom);
        tZoom = zoom + (event.wheelDelta>0 ? 0.05 : -0.05);
        if( tZoom > 1 || tZoom<0.1 ) return true;
        obj.style.zoom=tZoom;
        return false;
}
</script>
<a href="javascript:window.close()"><img

src="/UploadFiles/2021-04-02/20131120101711.png">

onmousewheel='return onWheelZoom(this)'></a>