I was facing same issue resolved by removing Jcrop from element as:
if ($('#imgCropImage').data('Jcrop')) {
$('#imgCropImage').data('Jcrop').destroy();
}
So you can try following:
$(function(){
var scalex = $('#scalex').val();
var scaley = $('#scaley').val();
var myJcrop = $.Jcrop('#imgCropImage',{
aspectRatio: 1,
onSelect: updateCoords,
boxWidth: scalex,
boxHeight: scaley
});
$('#imgtarget').click(function() {
if ($('#imgCropImage').data('Jcrop')) {
$('#imgCropImage').data('Jcrop').destroy();
}
scalex = $('#scalex').val();
scaley = $('#scaley').val();
myJcrop = $.Jcrop('#imgCropImage',{
aspectRatio: 1,
onSelect: updateCoords,
boxWidth: scalex,
boxHeight: scaley
});
});
});
Posted On:
04-Jan-2020 03:12