Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed about remove and cancelSelection #80

Open
petrospap opened this issue Jul 31, 2015 · 0 comments
Open

Help needed about remove and cancelSelection #80

petrospap opened this issue Jul 31, 2015 · 0 comments

Comments

@petrospap
Copy link

Hello
First of all thanks for this very useful script.
I need a help from you guys, my knowledge is not very good when it comes to javascript/jquery
I have a page where I load an external file with $ajax, in this file I load another file where I call lot of images with imgAreaSelect
i.e

$('#thump1').imgAreaSelect({ aspectRatio: '4:3',  onSelectChange: myfunction });
$('#thump2').imgAreaSelect({ aspectRatio: '4:3',  onSelectChange: myfunction });

is working as expected, but I have problem to remove imgAreaSelect with a click a button from the FIRST PAGE
what is works (but I got problems also) is something like this

$(document).on('click', '.button', function(){
var ias = $('#thumb1').imgAreaSelect({instance:true});
    if (ias){
       ias.cancelSelection();
       ias.remove();
    };
});

cancelSelection works, remove is NOT working
so if call cancelSelection in 2-3 images I got lot of hidden imgareaselect-outer divs
I use jquery.imgareaselect.dev.js
Can you please help me out here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant