1 Reply Latest reply on Feb 10, 2014 11:15 PM by Xoco

    Pause between animate(s) method(s) in code

    Xoco Level 3

      Hi, I have this code:

       

      sym.$("foco").animate({"opacity":"1"},{duration:2000, easing:"swing", queue:true});

      sym.$("foco").animate({"opacity":"0"},{duration:1000, easing:"swing", queue:true});

      // I need pause here

      sym.$("llanta").animate({"opacity":"1"},{duration:2000, easing:"swing", queue:true});

      sym.$("llanta").animate({"opacity":"0"},{duration:1000, easing:"swing", queue:true});

       

      And I need that execute first two lines and after the last two lines, but always execute both at the same time, how I implement a pause between animate method for execute sequentially?

       

      Thanks.

        • 1. Re: Pause between animate(s) method(s) in code
          Xoco Level 3

          Solved:

           

          sym.$("foco").animate({"opacity":"1"},{duration:2000, easing:"swing", queue:true}); // or fadeIn() method or sym.$("llanta").animate({"opacity":"1"}, 2000, "swing");

          sym.$("foco").animate({"opacity":"0"},{duration:1000, easing:"swing", queue:true}); // or fadeOut() method

          setTimeout(function(){

               sym.$("llanta").animate({"opacity":"1"},{duration:2000, easing:"swing", queue:true});

               sym.$("llanta").animate({"opacity":"0"},{duration:1000, easing:"swing", queue:true});

          },3000);

           

          Exist another way?