开发者

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));
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜