jcrop
用这个插件剪切图片,发现更换图片后大图不更新,小图更新了,求大牛帮忙解决啊,下面贴上问题代码
var msg = $.parseJSON(data);
if( msg.result_code == 1 ){
/*$("#row").hide();*/
$("#img").val( msg.result_des );
$("#target").attr("src",msg.result_des);
$(".preview").attr("src",msg.result_des);
$("#target").Jcrop({
minSize: [50,50],
setSelect: [0,0,200,200],
onChange:updatePreview,
onSelect:updatePreview,
onSelect:updateCoords,
aspectRatio:1
},
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;
});
//jcrop_api.setImage(msg.result_des);
$(".imgchoose").show(1000);
$("#avatar_submit").show(1000);
} else {
alert('上传失败');
}
},
var msg = $.parseJSON(data);
if( msg.result_code == 1 ){
/*$("#row").hide();*/
$("#img").val( msg.result_des );
$("#target").attr("src",msg.result_des);
$(".preview").attr("src",msg.result_des);
$("#target").Jcrop({
minSize: [50,50],
setSelect: [0,0,200,200],
onChange:updatePreview,
onSelect:updatePreview,
onSelect:updateCoords,
aspectRatio:1
},
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;
});
//jcrop_api.setImage(msg.result_des);
$(".imgchoose").show(1000);
$("#avatar_submit").show(1000);
} else {
alert('上传失败');
}
},
...全文
相关推荐
jquery-Jcrop实现图片裁剪截图上传和保存
**引入资源**:首先需要在HTML页面中引入jQuery库和Jcrop的CSS及JS文件。2. **绑定Jcrop**:选择要处理的图像元素,使用jQuery的`.Jcrop()`方法进行绑定。
Jcrop-demo
Jcrop-demo" 是一个示例项目,展示了如何集成和使用 Jcrop 进行图像处理操作。
Jcrop插件对图片进行裁剪示例
在本示例中,我们将深入探讨如何结合Jcrop与Java技术,实现一个完整的图片裁剪功能。首先,Jcrop的核心在于它的交互性和灵活性。
Jcrop图像裁剪中文文档
- 调用Jcrop。使用jQuery选择器选中带有ID的图片元素,并调用Jcrop函数进行初始化。2.
Jcrop 小测试源码
**Jcrop 小测试源码** 是一个前端项目,它主要使用了 Jcrop 这个JavaScript库来实现图像裁剪功能。


