jQuery插件imgAreaSelect使用

Imgareaselect 是一个 允许用户使用简单、直观的点击、拖动界面图像选择矩形区域的jQuery插件。该插件可用于 web 应用程序中轻松实现图像裁剪功能,以及其他功能,如照片标记、 图像编辑功能,等等.

支持浏览器:

             Firefox 2+, Opera 9.5+,  Google Chrome, Safari 3+, and Internet Explorer 6+.

 

一、加载

<head> ...   <linkrel="stylesheet"type="text/css"href="css/imgareaselect-default.css"/>
 
<scripttype="text/javascript"src="scripts/jquery.min.js"></script>
 
<scripttype="text/javascript"src="scripts/jquery.imgareaselect.pack.js"></script>

  ...
</head>

二、文档

中文:http://www.css88.com/EasyTools/javascript/jQueryPlugin/imgAreaSelect/index.html

English :http://odyniec.net/projects/imgareaselect/usage.html

三、使用

<img id="img5" src="" name="img5"/>

使用jquery的data储存数据:

$(document).ready(function () {
    var ias =$('img#img5').imgAreaSelect({
    fadeSpeed: 400,
    handles: true,
          instance: true,
          aspectRatio: '4:3',
          maxHeight: 84,
          maxWidth:94,
          onSelectEnd:function(img, selection) {
               $('#img5').data('x',selection.x1);
                $('#img5').data('y',selection.y1);
               $('#img5').data('w',selection.width);
                $('#img5').data('h',selection.height);
       }
   });
  }
 

转载于:https://www.cnblogs.com/java-zone/articles/2651235.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值