js图片拖拽查看并滑动鼠标可放大缩小

2020-04-07
<html>
<head>
    <style type="text/css">
        body{background-color:#555;color:#fff;}
        a img{border:none;}
        #imageView_container{border:2px solid #000;margin:0 auto;}
        #imageView_container.iv-loading{border:2px solid #ff6600;}
    </style>
</head>
<body>
    <div id="imageView_container">
    <img src="images/sad2.jpg" rel="images/sad2.jpg" alt="" onmousewheel="return bbimg(this)"/>
    </div>
</body>
</html>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.imageView.js"></script>
<script language="javascript">
    $(function() {
        $('#imageView_container').imageView({width:850, height:708});
    });
    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>

 

{/if}