Execute multiple jQuery effects on the same element in parallel

后端 未结 2 2248
后悔当初
后悔当初 2021-02-20 08:51

I see that this question was asked many times, but none of the solutions worked for me. I have two effects that I want to execute in parallel.

I want the box to fade-in

相关标签:
2条回答
  • 2021-02-20 09:27

    Try this

    function g()
     {
        $("#t").hide();
        $('#t').show();
        $("#t").animate({ opacity: 0.5 }, 0).effect("bounce", { times:3 },  { duration:400, queue: false});
        $("#t").animate({ opacity: 1 }, 0);
     }
    
    0 讨论(0)
  • 2021-02-20 09:32

    Chain the UI effects, and use dequeue() to execute them all at once.

    $("#t").hide().show("fade", {},  {duration:1200}).effect("bounce", { times:3 },  { duration:400}).dequeue();
    

    FIDDLE

    0 讨论(0)
提交回复
热议问题