croppic是前台剪切后,发回剪切的图片数据到PHP后台,然后后台将该数据保存为图片,并生成一条引用链接返回到前台。
croppic+PHP远程上传裁剪代码如下:var croppicHeaderOptions = {<br>
//uploadUrl:'img_save_to_file.php',<br>
cropData: {<br>
"dummyData": 1,<br>
"dummyData2": "asdas"<br>
},<br>
cropUrl: 'img_crop_to_file.php',<br>
customUploadButtonId: 'cropContainerHeaderButton',<br>
modal: false,<br>
processInline: true,<br>
loaderHtml: '<div>
<span></span><span></span><span></span>
</div> ',<br>
onBeforeImgUpload: function() {<br>
console.log('onBeforeImgUpload')<br>
},<br>
onAfterImgUpload: function() {<br>
console.log('onAfterImgUpload')<br>
},<br>
onImgDrag: function() {<br>
console.log('onImgDrag')<br>
},<br>
onImgZoom: function() {<br>
console.log('onImgZoom')<br>
},<br>
onBeforeImgCrop: function() {<br>
console.log('onBeforeImgCrop')<br>
},<br>
onAfterImgCrop: function() {<br>
console.log('onAfterImgCrop')<br>
},<br>
onReset: function() {<br>
console.log('onReset')<br>
},<br>
onError: function(errormessage) {<br>
console.log('onError:' + errormessage)<br>
}<br>
}<br>
var croppic = new Croppic('croppic', croppicHeaderOptions);
PHP裁剪演示地址:http://www.sucaihuo.com/js/480.html
PHP+croppic裁剪图片插件.zip ( 1.67 MB 下载:48 次 )
AD:真正免费,域名+虚机+企业邮箱=0元