Jump to content
Search Community

On restart, miss the first command

juanjis
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Posted

Hi,
Im having troubles with the restart, is missing the "first line" and dont is the same at start, the line  
 
tl.to("#imagen1", 6, { scale:1.2,alpha:1 , ease: Power0.easeOut }, "1");
 
doesnt work when i repeat it.
Do you know why, or how to fix this error??

(function () {

        //TWEENS
        var tl = new TimelineLite({
            //onComplete:rewind
            onStart:go1,
            onComplete:rewind
        });
        tl.timeScale(1);
        //tl.from("#logo",0, { scale:0.0, alpha:0, ease: Power2.easeOut }, "=0");
        //tl.addLabel("cartela1");

        tl.from("#imagen1",1, { scale:1.0, alpha:1, ease: Power2.easeOut }, "0");
        tl.from("#textomira1",1.5, {color:"#ffffff", ease: Power2.easeOut }, "0");
        tl.from("#texto1",1, {  alpha:1, ease: Power2.easeOut }, "0");
        tl.from(".marki",0, {backgroundColor:"#ffffff",color:"#ffffff",fontWeight:"normal", ease: Power2.easeOut }, "0");
        tl.to("#imagen1", 6, { scale:1.2,alpha:1 , ease: Power0.easeOut }, "1");
        tl.to("#textomira1",0.5, {color:"#000000",  ease: Power2.easeOut }, "1");
        tl.from("#textomira2",0, {color:"#ffffff", ease: Power2.easeOut }, "7");
        tl.to("#textomira2",1, {color:"#000000", ease: Power2.easeOut }, "2");
        tl.to(".marki",0.5, {backgroundColor:"#000000",color:"#ffffff",fontWeight:"bold", ease: Power2.easeOut }, "3");

        tl.addLabel("cartela2");

        tl.to("#texto1", 2, {  alpha:0 , ease: Power2.easeOut }, "5");
        tl.to("#imagen1", 2, { scale:1.22, alpha:0 , ease: Power0.easeOut }, "5");
        tl.from("#imagen2",2, { scale:1, alpha:0, ease: Power0.easeOut }, "5");
        tl.to("#imagen2",5, { scale:1.15, alpha:0, ease: Power4.easeOut }, "5");
        tl.to("#imagen2",2.5, { alpha:1, ease: Power0.easeOut }, "5");
        tl.from("#texto2",3, {alpha:0, ease: Power2.easeOut }, "6");

        tl.addLabel("cartela3");

        tl.to("#texto2", 2, {alpha:0 , ease: Power2.easeOut }, "10");
        tl.to("#imagen2", 2, { alpha:0 , ease: Power2.easeOut }, "10");
        tl.from("#imagen3",4, {  alpha:0, ease: Power2.easeOut }, "10");
        tl.from("#texto3",2, {alpha:0, ease: Power2.easeOut }, "10");
        tl.from("#comprar",0.5, {  alpha:1, ease: Power2.easeOut }, "10");
        tl.from("#comprar2",0.5, {  alpha:1, ease: Power2.easeOut }, "10");
        tl.from("#comprarespacio",0.5, {  alpha:0, ease: Power2.easeOut }, "10");

        tl.addLabel("cartela4");
        tl.to("#comprar",0.5, {  alpha:1,bottom:"-100%", ease: Power2.easeOut }, "12");
        tl.to("#comprar2",0.5, {  alpha:1,bottom:"0%", ease: Power2.easeOut }, "12");

        
        
        
        function go1(){          
            tl.gotoAndPlay(1);           
        }
        function rewind(){         
            tl.restart();
        }

}());
 

 
Thanks in advance!

Posted

i found the problem, 

 
        tl.to("#imagen1", 2, { scale:1.22, alpha:0 , ease: Power0.easeOut }, "5");
 
this line is called before the last tl.to("#imagen1".... ends, so maybe they throws me an error.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...