jquery - JCrop in Firefox attaches original image height/width -


we're using jcrop library cropping profile picture. when user changes profile picture, new picture still uses old image dimensions. works in chrome doesn't work in firefox. remove previous image , jcrop using destroy:

jcrop_api.destroy(); 

i have added line of code in attempt clear styles contains width , height.

$('#target').removeattr('style'); 

i have met issue , tried , discovered workaround works me:

there must alert() function if using firefox , jcrop destruction , initialization again.

// clear selector if (jcropapi) {     jcropapi.destroy();     }  initcropper();  // if browser firefox, fix bug stretching if (navigator.useragent.tolowercase().indexof('firefox') > -1) {     // firefox-related activities     alert('file loaded');  // alert necessary     if (jcropapi) {         jcropapi.destroy();     }     initcropper(); } 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -