皆さん、おはようございます。
私は今3時間この問題と戦っていますが、XDに勝つ方法を見つけることができません。成功すると、画像をロードし、jcropを初期化し、閉じると、選択の親指ベース。
これは正常に機能します...本当の問題は、モーダルで選択のリリースが必要なことです。ここに、jcrop Webサイトの指示に従ったキャッチがありますが、出られません。
問題を説明したので、コードの時間です:D
var FileUploader_img_frontale = new qq.FileUploader({
'element':document.getElementById("img_frontale"),
'debug':false,
'multiple':false,
'action':'http://url.com/upload',
'allowedExtensions':['jpg','png','jpeg','gif'],'sizeLimit':10485760,
'onComplete':function(id, fileName, responseJSON){
$('#pbar_img_frontale').css('display','none');
$('#img-front-body').html('<img id="cropbox1" src="url.com/images/tmp/b444ac06613fc8d63795be9ad0beaf55011936ac/'+responseJSON.filename+'" style="max-width:400px;max-height:400px;"/>');
function showCoordsFront(c){ $('#_opera_img_frontale').val(responseJSON.filename+'|'+c.x+'|'+c.y+'|'+c.x2+'|'+c.y2+'|0'); }
$('#cropbox1').Jcrop({
boxHeight: 400,
boxWidth:400,
trueSize: [responseJSON.width,responseJSON.height],
allowResize: true,
aspectRatio: 4/3,
onChange: showCoordsFront,
onSelect: showCoordsFront,
},function(){ jcrop1 = this; });
$('#_opera_img_frontale').val(responseJSON.filename);
front_uploaded=1;
$('#modal_img_front').modal('toggle');
},'onProgress':function(id, fileName, loaded, total){ $('#pbar_img_frontale').css('display','block'); $('#bar_img_frontale').css('width',((loaded*100)/total)+'%'); },'params':{'PHPSESSID':'400659255ef857e043b5ab1651406f50','YII_CSRF_TOKEN':'c8248bc34b5371edf162292691dbcf23dc1e697a'}});
ご覧のとおり、これはアップロード ファイルの jquery ajax です。
function(){ jcrop1 = this; }
objを取得するために必要ですが、ajax経由で画像をアップロードしないと機能しますが、どうすればよいかわかりません
var jcrop1;
$("#jcrop1-release").click(function(){
jcrop1.setSelect([0,0,0,0]);
jcrop1.release();
});
誰でも私を助けることができますか?
前もって感謝します
ファビオ