So first, I do this:
$(document).ready(function(){
$("form#delete_admire").submit(function() {
// we want to store the values from the form input box, then send via ajax below
var deleteIdAdmire = $('#deleteIdAdmire').attr('value');
var location = 'li#liadmire_'+ deleteIdAdmire;
$.ajax({
type: "POST",
url: "../admire/delete.php",
data: "deleteIdAdmire="+ deleteIdAdmire,
success: function(){
$(location).hide(function(){$('div.success2').fadeIn();});
}
});
return false;
});
});
This works… now for the past hour or so I’ve been trying to get the ‘div.success2’ to fade out and to reset the script so when someone clicks the delete again, it will run all over again. I’m very new to JQuery and javascript, I apologize for my probably very stupid question. Thank you all in advance!
I see no reason why this code can’t run multiple times. The
fadeOutcan be done very easily:Replace
5000with whatever delay you would like before it fades out.