I'm trying to create a popup message in my app. On success I want to open a dialog, animate it...and then close it. I guess a better question should have been, "How do you create a timed popup in Jquery...but anyway when I run my code it appears that my dialog appears for just a split second. If I remove the dialog('close') line it works up until that point. Does jquery fire these commands in sequence or in parallel?
$.ajax({
type: "POST",
url: "/Sales",
data: { customer: [id] },
success: function(msg) {
$('#thanks').dialog('open');
$('#thanks').animate({ backgroundColor: '#aa0000', color: '#fff', width: 500 }, 2000);
$('#thanks').dialog('close');
}
});