Answer the question
In order to leave comments, you need to log in
How to detect an initialized plugin (croppie or whatever)?
I am using croppie to edit images before sending to server. The task is to initialize and stop the plugin on demand:
$('#someID').croppie({
viewport: {
width: 128,
height: 128
}
});
$('#someID').croppie('bind', {
url: 'some base64 encoded image'
});
$('#someID').toggle();
$('#someID').croppie('bind');
croppie.min.js:1 Uncaught Error: Croppie: Can't initialize croppie more than once
// it supposed to be the answer, however it doesn't work correctly for me.
if (!jQuery().fn.croppie) {
$('#someID').croppie({
viewport: {
width: 128,
height: 128
}
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question