Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clear image in only one dropify

Tags:

jquery

dropify

Dropify from Github

Anybody can help me with this? I want to manually remove uploaded image inside this dropify. I have more than one dropify in a page. Whenever I try to remove, all of the images inside each dropify will be removed.

Can someone help me? Because I think this library is already inactive.

Whenever I use this code in one dropify, all other dropify images will also be removed.

$(".dropify-clear").click(); 
like image 546
Paul John Pulumbarit Avatar asked Mar 04 '17 16:03

Paul John Pulumbarit


3 Answers

$(".dropify-clear").trigger("click"); worked for me

like image 100
Khaan Avatar answered Nov 15 '22 14:11

Khaan


Get the parent wrapper of the element with the id, then trigger the click on the remove button.

for example

$('#image1').parent().find(".dropify-clear").trigger('click');
like image 3
Amit Sharma Avatar answered Nov 15 '22 12:11

Amit Sharma


".dropify-clear" refers to all elements with the class name dropify-clear.

You should add an id to the specific element you want to remove and then refer to it in jQuery like this: "#idName"

like image 1
Alvin Abia Avatar answered Nov 15 '22 14:11

Alvin Abia