当前位置: 移动技术网 > IT编程>开发语言>Jquery > jQuery点击图片放大拖动查看效果

jQuery点击图片放大拖动查看效果

2018年10月14日  | 移动技术网IT编程  | 我要评论

效果如图:

放大前:

放大后(可拖动图片浏览):

源码如下:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>jquery点击图片拖动放大查看效果</title>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.imageview.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#imageview_container').imageview({ width: 850, height: 708 });
        });
    </script>
    <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" class="" style="width: 850px; height: 708px; overflow: hidden; position: relative; cursor: -moz-zoom-in;">
        <img src="http://www.xwcms.net/webanneximages/fileannex/201506/27268/images/12awe51.jpg" rel="http://www.xwcms.net/webanneximages/fileannex/201506/27268/images/sad2.jpg" alt="" id="image_view_1" style="visibility: visible; position: absolute; left: 0px; top: 0px;">
    </div>
</body>
</html>

 

js资源下载地址:https://pan.baidu.com/s/1ew7iernrbawz0kuhr21s0a#list/path=%2f

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网