jQuery animation not happening when followed by a dequeue event
I'm trying to display an image while I'm doing some Ajax updating (which I've placed in a queue). Here's the code
$(".SaveButton").click(function () {
$(".SavingImage").fadeIn("fast");
$(this).dequeue("Updates");
$(".SavingImage").fadeOut("fast");
$(".ResultItem"开发者_C百科).data("isDirty", false)
});
.show() and .hide() work, but not the animations. Let me know if more code is needed, I figured this would suffice.
you need to add the function in the call back of the animate function. Something like this:
$(".SaveButton").click(function () {
$(".SavingImage").fadeIn("fast",function(){
$(this).dequeue("Updates");
});
$(".SavingImage").fadeOut("fast");
$(".ResultItem").data("isDirty", false));
});
精彩评论