jQuery.jcrop 基本参数
来源:互联网 发布:便签软件下载 编辑:程序博客网 时间:2024/05/16 01:23
<script language="Javascript"> <!-- jQuery(function($){ // Create variables (in this scope) to hold the API and image size var jcrop_api, boundx, boundy; $('#cropbox').Jcrop({ minSize: [0,0], maxSize:[0,0], setSelect: [0,0,0,0], boxWidth:800, borderOpacity:0.3, keySupport:false, dragEdges:false, allowSelect:false, allowResize:false, bgOpacity:0.2, boundary:0, //allowMove:false, addClass: 'jcrop-handle', onSelect: updateCoords, }, function(){ // Use the API to get the real image size var bounds = this.getBounds(); boundx = bounds[0]; boundy = bounds[1]; // Store the API in the jcrop_api variable jcrop_api = this; }); function updateCoords(c) { $('#x').val(c.x); $('#y').val(c.y); $('#w').val(c.w); }; function checkCoords() { if (parseInt($('#w').val())) return true; alert('请选择裁剪区域'); return false; }; });--></script>
基本使用方法如下:
一、在head部分(<head>和</head>之间)插入相关css和js文件。
<link rel="stylesheet" href="css/jquery.Jcrop.css">
<script src="js/jquery.js"></script>
<script src="js/jquery.Jcrop.js"></script>
二、在head部分插入回调函数等相关处理参数
三、给相关图片加上id以便识别。
<img id="cropbox" src="x.jpg">
这样就能实现最简单的裁剪效果,至于如何结合php等动态语句处理图片,在置顶的文章里已经给出了示例。
下表给出基本options参数设置:
下表是api方法
- jQuery.jcrop 基本参数
- jcrop基本参数一览
- jcrop基本参数一览
- jquery.Jcrop API详解
- jQuery Jcrop 图像裁剪
- jQuery Jcrop 图像裁剪
- jquery.Jcrop API详解
- JQuery Jcrop—JQuery Jcrop 图像裁剪工具学习
- jQuery图片剪裁插件 Jcrop
- jquery插件图片裁剪jcrop
- thinkphp jquery剪切图片 Jcrop
- jQuery jcrop插件截图使用方法
- jQuery图片剪裁插件 Jcrop
- jQuery jcrop插件截图使用方法
- jQuery jcrop插件截图使用方法
- 实现图像剪裁 jquery.Jcrop
- jQuery 图像裁剪插件Jcrop
- mini_magick+jquery.Jcrop+jquery.form.min
- SQLYog不能建外键
- springMVC+mybatis配置详解
- windows消息和消息队列
- Java中HashMap遍历的两种方式
- 测试kestrel的队列(一)
- jQuery.jcrop 基本参数
- 2010年pmp美国项目管理考试项目职业道德练习题及答案2
- Memcache安装笔记
- linux游戏服务器搭建(一)
- 解压缩PNG deflate压缩IDAT数据
- Storm VS Hadoop
- cocos2d-x 学习笔记《二》 ---------异步加载图片资源
- 2010年pmp美国项目管理考试项目职业道德练习题及答案3
- ext中json页面处理接收的值