Last active
August 29, 2015 14:06
-
-
Save taleeb35/2823ebab0cc6a32e4e71 to your computer and use it in GitHub Desktop.
Fade in Message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('a.delete').click(function(e) { | |
var __this = this; | |
e.preventDefault(); | |
var parent = $(this).parent("td").parent("tr"); | |
$.ajax({ | |
type: 'get', | |
url: $(__this).attr("href"), | |
dataType: 'json', | |
beforeSend: function() { | |
parent.animate({'backgroundColor':'#fb6c6c'},1000); | |
}, | |
success: function(response) { | |
if(response.success){ | |
alert("Are you sure to delete the user?"); | |
$('.message').delay(1000).hide('highlight', {color: '#66cc66'}, 1500); | |
parent.slideUp(3000,function() { | |
parent.remove(); | |
}); | |
}else{ | |
alert("Failed to delete the user"); | |
parent.animate({'backgroundColor':'#fff'},1000);//Restore your background back | |
} | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment