1

我想知道是否可以仅在前一个功能完成后才启动功能。我在下面列出了两个函数,我试图一个接一个地运行。谢谢!

                var controller = $.superscrollorama();


                controller.addTween('#graphicOne', TweenMax.from( $('#graphicOne'), .7, {css:{right:'1000px'}, ease:Back.easeOut}));
                controller.addTween('#graphicTwo', TweenMax.from( $('#graphicTwo'), .7, {css:{left:'1000px'}, ease:Back.easeOut})); 
                controller.addTween('#graphicThree', TweenMax.from( $('#graphicThree'), .7, {css:{right:'1000px'}, ease:Back.easeOut}));        
            }

功能二:

        function footerAnimation() {
            TweenMax.from( $('#footerTextLight'), .7, {css:{opacity:'0'}})
        }
4

1 回答 1

1

使用onComplete回调

controller.addTween(
       '#graphicThree', 
       TweenMax.from( $('#graphicThree'), .7, 
                     {
                     css:{right:'1000px'},
                     ease:Back.easeOut, 
                     onComplete : footerAnimation
                    }
                  )
       );

在动画完成时将函数传递给补间。

http://johnpolacek.github.io/superscrollorama/

于 2013-10-14T04:44:14.770 回答