Reputation: 155
Using blueimp jquery-file-upload, I'd like to change a variable when clicking the cancel button.
The cancel button is displayed at right of the each file added.
I tried below but nothing has been happend.
How can I do this?
$(function () {
var file_count = 0
$('#fileupload').fileupload({
acceptFileTypes: /(\.|\/)(pdf|PDF)$/i
}).bind('fileuploadadd', function (e, data) {
file_count += data.files.length
$('td.cancel button.btn-warning').click(function (e) {
file_count -= 1
});
});
});
Upvotes: 2
Views: 545
Reputation: 9013
just try it:
$('body').on('click', 'button.cancel', function(e,data) {
console.log('cancel click');
});
Upvotes: 1