10

I am trying to destroy cropper when model close here is my code i am using https://github.com/fengyuanchen/cropperjs

var image = document.getElementById('image_cropper'); 
var cropper = new Cropper(image); 
cropper.destroy(); 
cropper = null;
var cropper = new Cropper(image , options); // options are defined on top

I select one image and close model after select new one and here is the result enter image description here

M Arfan
  • 4,384
  • 4
  • 29
  • 46
  • were you able to find any solution? – sairfan Jul 15 '20 at 20:00
  • I was able to do it `$('#croppermain').html('');` `$('#croppermain').append(el);` `cropper.constructor(el);` where el is image element after setting new src, i understand its not an ideal way let me know if there is better workaround – sairfan Jul 15 '20 at 20:14

0 Answers0