5、jQuery插件之jqzoom放大镜插件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="jquery.jqzoom.js" type="text/javascript"></script>
<link href="jqzoom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
/*使用jqzoom*/
    $(function() {
        $(".jqzoom").jqueryzoom({
            xzoom: 400, //放大图的宽度(默认是 200)
            yzoom: 400, //放大图的高度(默认是 200)
            offset: 10, //离原图的距离(默认是 10)
            position: "right", //放大图的定位(默认是 "right")
            preload: 1
        });
    });
</script>
</head>
<body>
<div class="jqzoom">
<img src="small.jpg" style="width:300px; height:300px;"  jqimg="big.jpg" id="bigImg"/>
</div>
</body>

</html>


版本二:(www.jq22.com官网的demo)


<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
<title></title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.jqzoom1.0.1.js"></script>
<script type="text/javascript" src="jqzoom.pack.1.0.1.js"></script>
<link href="jqzoom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
/*使用jqzoom*/
  $(function(){

      var setting={zoomType:"reverse",

                    zoomWidth:200,

                    zoomHeight:200,

                    xOffset:20,

                    yOffset:20,

                    lens:true,

                    title:true,

                    imageOpacity:0.5

               };

      $(".zoom").jqzoom();

  });


</script>
</head>
<body>
<div>

  <h2>图片放大镜</h2>

  <a href="big.jpg" class="zoom"> <img src="small.jpg" title="我的笔记本" /> </a> </div>


</body>
</html>
效果:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值