PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, July 28, 2022

[FIXED] How to destroy Croppie jQuery existing instance?

 July 28, 2022     crop, croppie, javascript, jquery     No comments   

Issue

I've using Croppie jQuery Library for crop a image but facing a problem when it will create multiple instances.

I've found no documentation about destroy instance.

function initCrop() {
    var $uploadCrop;
    $('#image_crop').destroy();
    $uploadCrop = $('#image_crop').croppie({
        viewport: {
            width: WIDTH,
            height: HEIGHT,
            type: 'square'
        },
        boundary: {
            width: 798,
            height: 480
        },
        exif: true
    });
}

Solution

Found a solution:

$('#image_crop').croppie('destroy');

For more detail refer Croppie.



Answered By - Govind Samrow
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing