我在.dialog()函数内部制作Jcrop。运行良好,但我无法通过我的X和Y等值!.dialog中的Jcrop()
函数“updateCoords”的作品,但我不能通过它价值throe阿贾克斯!火虫说,我想通过POST的变量没有定义,但“如何!” - 我在函数updateCoords()中定义变量! XD
function open_original(gallery_id, image_name){
$("#image_crop_canves").dialog({
modal:true,
width:634,
height:741,
buttons:{
"SAVE":function(){
$.ajax({
url: "send.php",
type: "POST",
data: "a=crop&x="+cx+"&y="+cy+"&w="+cw+"&h="+ch+"&gid="+gallery_id+"&id="+image_name,
success: function(){
$("#image_crop_canves").dialog('close');
window.location();
}
});
},
"CLOSE":function(){
$("#image_crop_canves").dialog('close');
}
}
});
$("#image_crop").html("<div id=\"image_holder_crop\"><img id=\"cropbox\" src=\"../../pics/gallery/" + gallery_id + "/original/" + image_name + "\" /></div>");
$("#image_crop_canves").dialog('open');
function updateCoords(c) {
var cx = c.x;
var cy = c.y;
var cx2 = c.x2;
var cy2 = c.y2;
var cw = c.w;
var ch = c.h;
}
$('#cropbox').Jcrop({
aspectRatio: 140/360,
onSelect: updateCoords,
setSelect: [0, 0, 140, 360],
minSize: [140, 360]
});
}