1
I want to use Jcrop in one .dialog()
, but it is not working properly, the selection of Jcrop is getting wrong, distorting the image:
Instead of doing like this:
The js is like this:
$('.imagem_principal').live('click', function() {
var foto = $(this).parent().parent().find('a').attr('href');
var form = '<div id="box-crop"><img src="'+foto+'" id="foto-crop"></div>';
$(form).dialog({
open: function(event, ui) {
$("#foto-crop").Jcrop({
setSelect: [0, 0, 140, 360],
minSize: [140, 360],
aspectRatio: 1
});
},
autoOpen: true,
width: 800,
height: 600,
title: "Corte imagem principal",
buttons: {
"Cortar foto": function() {
$( this ).dialog( "close" );
},
"Cancelar": function() {
$( this ).dialog( "close" );
}
}
});
});
even removing aspectRatio, keeps selecting wrong, repeating the image in the selection area instead of selecting only the marked area,and when I move the selected area to the right, the selection is as if it were empty.
– fernandoandrade
ah, thanks for the tip of aspectRatio: 16 / 9 +1
– fernandoandrade