chaining fadeIn, fadeOut, animate, wrong execution orderchange text of same element multiple timesCSS - IE7 & 8 IssuesHow to implement multiple popups?jQuery Animation, Chaining, .each() and .animate() (or fadeIn() and fadeOut())replace .animate() with fadeIn/ fadeOutinterval of animation fadeIn fadeOutfadeIn() / fadeOut() animation not playingJquery animation/fadeIn/fadeOutText fadein/fadeout animation in loopjquery animation for fadein and fadeoutTable CSS is not showing up at all

Unary Enumeration

Why does the painters tape have to be blue?

Small solutions to modular arithmetic linear congruence

How does the Earth's center produce heat?

Is a world with one country feeding everyone possible?

Who wrote “A writer only begins a book. A reader finishes it.”

How do you earn the reader's trust?

Status of proof by contradiction and excluded middle throughout the history of mathematics?

Are there guidelines for finding good names for LaTeX 2e packages and control sequences defined in these packages?

How did the Allies achieve air superiority on Sicily?

Seeking closure over someone I have unblocked but whom I learned have passed on

Are cells guaranteed to get at least one mitochondrion when they divide?

Could a rotating ring space station have a bolo-like extension?

Why is 'additive' EQ more difficult to use than 'subtractive'?

Testing using real data of the customer

Is there an idiom that means that you are in a very strong negotiation position in a negotiation?

Knight's Tour on a 7x7 Board starting from D5

Was this scene in S8E06 added because of fan reactions to S8E04?

How to teach an undergraduate course without having taken that course formally before?

What is the limit to a Glyph of Warding's trigger?

Is keeping the forking link on a true fork necessary (Github/GPL)?

Python script to extract text from PDF with images

Ribbon Cable Cross Talk - Is there a fix after the fact?

Cisco 3750X Power Cable



chaining fadeIn, fadeOut, animate, wrong execution order


change text of same element multiple timesCSS - IE7 & 8 IssuesHow to implement multiple popups?jQuery Animation, Chaining, .each() and .animate() (or fadeIn() and fadeOut())replace .animate() with fadeIn/ fadeOutinterval of animation fadeIn fadeOutfadeIn() / fadeOut() animation not playingJquery animation/fadeIn/fadeOutText fadein/fadeout animation in loopjquery animation for fadein and fadeoutTable CSS is not showing up at all






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to programmatically change some text, adding a class, animating it. So far I have this code:



.red 
font-size: 150%;
color: red;


<font id="test" size="7">0000000000000000</font>

$('#test').fadeOut(500, function()
const $this = $(this);
$this.text('11111111111111111111')
.fadeIn(500)
.fadeOut(500, () => $this.text('2222222222222222')
.css("color", "green"))
.addClass("red")
.fadeIn(500)
.animate('margin-left': '250px', duration: 3000, complete: function()
$this.fadeOut(200)

)
);


Unfortunately, the order seems to be messed up. The class "red" is added to the text "1111111....." instead to the text "222222...." and I don't understand why.



Here the jsFiddle: http://jsfiddle.net/3nus4wpy/2/










share|improve this question






























    0















    I am trying to programmatically change some text, adding a class, animating it. So far I have this code:



    .red 
    font-size: 150%;
    color: red;


    <font id="test" size="7">0000000000000000</font>

    $('#test').fadeOut(500, function()
    const $this = $(this);
    $this.text('11111111111111111111')
    .fadeIn(500)
    .fadeOut(500, () => $this.text('2222222222222222')
    .css("color", "green"))
    .addClass("red")
    .fadeIn(500)
    .animate('margin-left': '250px', duration: 3000, complete: function()
    $this.fadeOut(200)

    )
    );


    Unfortunately, the order seems to be messed up. The class "red" is added to the text "1111111....." instead to the text "222222...." and I don't understand why.



    Here the jsFiddle: http://jsfiddle.net/3nus4wpy/2/










    share|improve this question


























      0












      0








      0








      I am trying to programmatically change some text, adding a class, animating it. So far I have this code:



      .red 
      font-size: 150%;
      color: red;


      <font id="test" size="7">0000000000000000</font>

      $('#test').fadeOut(500, function()
      const $this = $(this);
      $this.text('11111111111111111111')
      .fadeIn(500)
      .fadeOut(500, () => $this.text('2222222222222222')
      .css("color", "green"))
      .addClass("red")
      .fadeIn(500)
      .animate('margin-left': '250px', duration: 3000, complete: function()
      $this.fadeOut(200)

      )
      );


      Unfortunately, the order seems to be messed up. The class "red" is added to the text "1111111....." instead to the text "222222...." and I don't understand why.



      Here the jsFiddle: http://jsfiddle.net/3nus4wpy/2/










      share|improve this question
















      I am trying to programmatically change some text, adding a class, animating it. So far I have this code:



      .red 
      font-size: 150%;
      color: red;


      <font id="test" size="7">0000000000000000</font>

      $('#test').fadeOut(500, function()
      const $this = $(this);
      $this.text('11111111111111111111')
      .fadeIn(500)
      .fadeOut(500, () => $this.text('2222222222222222')
      .css("color", "green"))
      .addClass("red")
      .fadeIn(500)
      .animate('margin-left': '250px', duration: 3000, complete: function()
      $this.fadeOut(200)

      )
      );


      Unfortunately, the order seems to be messed up. The class "red" is added to the text "1111111....." instead to the text "222222...." and I don't understand why.



      Here the jsFiddle: http://jsfiddle.net/3nus4wpy/2/







      javascript jquery html






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 at 21:49









      Jack Bashford

      22.1k52051




      22.1k52051










      asked Mar 23 at 21:47









      user838531user838531

      14919




      14919






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You have to put everything asynchronous (except further fades) that you want to happen on fade inside the fade callback:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this
          .css("color", "green")
          .addClass("red")
          )
          .fadeIn(500, () =>
          $this.animate(
          'margin-left': '250px'
          ,
          duration: 3000,
          complete: function()
          $this.fadeOut(200)

          );
          );
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>





          You can also call delay to create a delay before the next chained function runs, eg:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this.css("color", "green").addClass("red")
          )
          .fadeIn(500)
          .delay(500)
          .animate(
          'margin-left': '250px'
          ,
          duration: 3000
          )
          .delay(3000)
          .fadeOut(5500)
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>








          share|improve this answer

























          • I don't get it. When I need to add more fadein, fadeout functions, where do I place them, in the callback of the animation? This here for example doesn't work:$('#test').fadeOut(500, function() const $this = $(this); $this.text('11111111111111111111') .fadeIn(500) .fadeOut(500, () => $this.text('2222222222222222'); $this .css("color", "green") .addClass("red") ) .fadeIn(500, () => $this.animate( 'margin-left': '250px' , duration: 3000) ) .fadeOut(5500) );

            – user838531
            Mar 23 at 22:54












          • It seems not possible to add another fadein or fadeout after the fadein having the animate() as callback function.

            – user838531
            Mar 23 at 22:55











          • I need to be able to chain unlimited number of fadeIn, fadeOut, animate. How do I do that?

            – user838531
            Mar 23 at 22:58











          • You can also use delay, see edit

            – Snow
            Mar 23 at 23:03











          • Ok, so it was actually wrong to put the animation() function as callback of the second fadeIn(), and I also don't need to use the callback of the animation() function here, right?

            – user838531
            Mar 23 at 23:15











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318709%2fchaining-fadein-fadeout-animate-wrong-execution-order%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You have to put everything asynchronous (except further fades) that you want to happen on fade inside the fade callback:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this
          .css("color", "green")
          .addClass("red")
          )
          .fadeIn(500, () =>
          $this.animate(
          'margin-left': '250px'
          ,
          duration: 3000,
          complete: function()
          $this.fadeOut(200)

          );
          );
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>





          You can also call delay to create a delay before the next chained function runs, eg:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this.css("color", "green").addClass("red")
          )
          .fadeIn(500)
          .delay(500)
          .animate(
          'margin-left': '250px'
          ,
          duration: 3000
          )
          .delay(3000)
          .fadeOut(5500)
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>








          share|improve this answer

























          • I don't get it. When I need to add more fadein, fadeout functions, where do I place them, in the callback of the animation? This here for example doesn't work:$('#test').fadeOut(500, function() const $this = $(this); $this.text('11111111111111111111') .fadeIn(500) .fadeOut(500, () => $this.text('2222222222222222'); $this .css("color", "green") .addClass("red") ) .fadeIn(500, () => $this.animate( 'margin-left': '250px' , duration: 3000) ) .fadeOut(5500) );

            – user838531
            Mar 23 at 22:54












          • It seems not possible to add another fadein or fadeout after the fadein having the animate() as callback function.

            – user838531
            Mar 23 at 22:55











          • I need to be able to chain unlimited number of fadeIn, fadeOut, animate. How do I do that?

            – user838531
            Mar 23 at 22:58











          • You can also use delay, see edit

            – Snow
            Mar 23 at 23:03











          • Ok, so it was actually wrong to put the animation() function as callback of the second fadeIn(), and I also don't need to use the callback of the animation() function here, right?

            – user838531
            Mar 23 at 23:15















          1














          You have to put everything asynchronous (except further fades) that you want to happen on fade inside the fade callback:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this
          .css("color", "green")
          .addClass("red")
          )
          .fadeIn(500, () =>
          $this.animate(
          'margin-left': '250px'
          ,
          duration: 3000,
          complete: function()
          $this.fadeOut(200)

          );
          );
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>





          You can also call delay to create a delay before the next chained function runs, eg:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this.css("color", "green").addClass("red")
          )
          .fadeIn(500)
          .delay(500)
          .animate(
          'margin-left': '250px'
          ,
          duration: 3000
          )
          .delay(3000)
          .fadeOut(5500)
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>








          share|improve this answer

























          • I don't get it. When I need to add more fadein, fadeout functions, where do I place them, in the callback of the animation? This here for example doesn't work:$('#test').fadeOut(500, function() const $this = $(this); $this.text('11111111111111111111') .fadeIn(500) .fadeOut(500, () => $this.text('2222222222222222'); $this .css("color", "green") .addClass("red") ) .fadeIn(500, () => $this.animate( 'margin-left': '250px' , duration: 3000) ) .fadeOut(5500) );

            – user838531
            Mar 23 at 22:54












          • It seems not possible to add another fadein or fadeout after the fadein having the animate() as callback function.

            – user838531
            Mar 23 at 22:55











          • I need to be able to chain unlimited number of fadeIn, fadeOut, animate. How do I do that?

            – user838531
            Mar 23 at 22:58











          • You can also use delay, see edit

            – Snow
            Mar 23 at 23:03











          • Ok, so it was actually wrong to put the animation() function as callback of the second fadeIn(), and I also don't need to use the callback of the animation() function here, right?

            – user838531
            Mar 23 at 23:15













          1












          1








          1







          You have to put everything asynchronous (except further fades) that you want to happen on fade inside the fade callback:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this
          .css("color", "green")
          .addClass("red")
          )
          .fadeIn(500, () =>
          $this.animate(
          'margin-left': '250px'
          ,
          duration: 3000,
          complete: function()
          $this.fadeOut(200)

          );
          );
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>





          You can also call delay to create a delay before the next chained function runs, eg:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this.css("color", "green").addClass("red")
          )
          .fadeIn(500)
          .delay(500)
          .animate(
          'margin-left': '250px'
          ,
          duration: 3000
          )
          .delay(3000)
          .fadeOut(5500)
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>








          share|improve this answer















          You have to put everything asynchronous (except further fades) that you want to happen on fade inside the fade callback:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this
          .css("color", "green")
          .addClass("red")
          )
          .fadeIn(500, () =>
          $this.animate(
          'margin-left': '250px'
          ,
          duration: 3000,
          complete: function()
          $this.fadeOut(200)

          );
          );
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>





          You can also call delay to create a delay before the next chained function runs, eg:






          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this.css("color", "green").addClass("red")
          )
          .fadeIn(500)
          .delay(500)
          .animate(
          'margin-left': '250px'
          ,
          duration: 3000
          )
          .delay(3000)
          .fadeOut(5500)
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>








          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this
          .css("color", "green")
          .addClass("red")
          )
          .fadeIn(500, () =>
          $this.animate(
          'margin-left': '250px'
          ,
          duration: 3000,
          complete: function()
          $this.fadeOut(200)

          );
          );
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>





          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this
          .css("color", "green")
          .addClass("red")
          )
          .fadeIn(500, () =>
          $this.animate(
          'margin-left': '250px'
          ,
          duration: 3000,
          complete: function()
          $this.fadeOut(200)

          );
          );
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>





          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this.css("color", "green").addClass("red")
          )
          .fadeIn(500)
          .delay(500)
          .animate(
          'margin-left': '250px'
          ,
          duration: 3000
          )
          .delay(3000)
          .fadeOut(5500)
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>





          $('#test').fadeOut(500, function() 
          const $this = $(this);
          $this.text('11111111111111111111')
          .fadeIn(500)
          .fadeOut(500, () =>
          $this.text('2222222222222222');
          $this.css("color", "green").addClass("red")
          )
          .fadeIn(500)
          .delay(500)
          .animate(
          'margin-left': '250px'
          ,
          duration: 3000
          )
          .delay(3000)
          .fadeOut(5500)
          );

          .red 
          font-size: 150%;
          color: red;

          <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

          <font id="test" size="7">0000000000000000</font>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 23 at 23:03

























          answered Mar 23 at 21:50









          SnowSnow

          1,017225




          1,017225












          • I don't get it. When I need to add more fadein, fadeout functions, where do I place them, in the callback of the animation? This here for example doesn't work:$('#test').fadeOut(500, function() const $this = $(this); $this.text('11111111111111111111') .fadeIn(500) .fadeOut(500, () => $this.text('2222222222222222'); $this .css("color", "green") .addClass("red") ) .fadeIn(500, () => $this.animate( 'margin-left': '250px' , duration: 3000) ) .fadeOut(5500) );

            – user838531
            Mar 23 at 22:54












          • It seems not possible to add another fadein or fadeout after the fadein having the animate() as callback function.

            – user838531
            Mar 23 at 22:55











          • I need to be able to chain unlimited number of fadeIn, fadeOut, animate. How do I do that?

            – user838531
            Mar 23 at 22:58











          • You can also use delay, see edit

            – Snow
            Mar 23 at 23:03











          • Ok, so it was actually wrong to put the animation() function as callback of the second fadeIn(), and I also don't need to use the callback of the animation() function here, right?

            – user838531
            Mar 23 at 23:15

















          • I don't get it. When I need to add more fadein, fadeout functions, where do I place them, in the callback of the animation? This here for example doesn't work:$('#test').fadeOut(500, function() const $this = $(this); $this.text('11111111111111111111') .fadeIn(500) .fadeOut(500, () => $this.text('2222222222222222'); $this .css("color", "green") .addClass("red") ) .fadeIn(500, () => $this.animate( 'margin-left': '250px' , duration: 3000) ) .fadeOut(5500) );

            – user838531
            Mar 23 at 22:54












          • It seems not possible to add another fadein or fadeout after the fadein having the animate() as callback function.

            – user838531
            Mar 23 at 22:55











          • I need to be able to chain unlimited number of fadeIn, fadeOut, animate. How do I do that?

            – user838531
            Mar 23 at 22:58











          • You can also use delay, see edit

            – Snow
            Mar 23 at 23:03











          • Ok, so it was actually wrong to put the animation() function as callback of the second fadeIn(), and I also don't need to use the callback of the animation() function here, right?

            – user838531
            Mar 23 at 23:15
















          I don't get it. When I need to add more fadein, fadeout functions, where do I place them, in the callback of the animation? This here for example doesn't work:$('#test').fadeOut(500, function() const $this = $(this); $this.text('11111111111111111111') .fadeIn(500) .fadeOut(500, () => $this.text('2222222222222222'); $this .css("color", "green") .addClass("red") ) .fadeIn(500, () => $this.animate( 'margin-left': '250px' , duration: 3000) ) .fadeOut(5500) );

          – user838531
          Mar 23 at 22:54






          I don't get it. When I need to add more fadein, fadeout functions, where do I place them, in the callback of the animation? This here for example doesn't work:$('#test').fadeOut(500, function() const $this = $(this); $this.text('11111111111111111111') .fadeIn(500) .fadeOut(500, () => $this.text('2222222222222222'); $this .css("color", "green") .addClass("red") ) .fadeIn(500, () => $this.animate( 'margin-left': '250px' , duration: 3000) ) .fadeOut(5500) );

          – user838531
          Mar 23 at 22:54














          It seems not possible to add another fadein or fadeout after the fadein having the animate() as callback function.

          – user838531
          Mar 23 at 22:55





          It seems not possible to add another fadein or fadeout after the fadein having the animate() as callback function.

          – user838531
          Mar 23 at 22:55













          I need to be able to chain unlimited number of fadeIn, fadeOut, animate. How do I do that?

          – user838531
          Mar 23 at 22:58





          I need to be able to chain unlimited number of fadeIn, fadeOut, animate. How do I do that?

          – user838531
          Mar 23 at 22:58













          You can also use delay, see edit

          – Snow
          Mar 23 at 23:03





          You can also use delay, see edit

          – Snow
          Mar 23 at 23:03













          Ok, so it was actually wrong to put the animation() function as callback of the second fadeIn(), and I also don't need to use the callback of the animation() function here, right?

          – user838531
          Mar 23 at 23:15





          Ok, so it was actually wrong to put the animation() function as callback of the second fadeIn(), and I also don't need to use the callback of the animation() function here, right?

          – user838531
          Mar 23 at 23:15



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318709%2fchaining-fadein-fadeout-animate-wrong-execution-order%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript