Share Posted March 31, 2016 I am following the iHateTomato course and try to modify something. I want the main timeline to stop at the end of all the stagger effect like so: .staggerFromTo($pixel, 1, {autoAlpha: 0, cycle: { scale: ['0.5', '2'] }}, {autoAlpha: 1, scale: '1', ease: Elastic.easeOut.config(1, 0.3)}, 0.3, pauseProjects, [projectClass]) .add('pixelsIn') And the pauseProject function is function pauseProjects(projectClass){ console.log ("Main timeline pause!"); tlProjects.pause(); } It is throwing this error: TweenMax.min.js:16 Uncaught TypeError: b[a].apply is not a function And the console never log. What is wrong?! Link to comment Share on other sites More sharing options...
Share Posted March 31, 2016 Hello hughred22, and Welcome to the GreenSock Forum! You can go to this link and send ihatetomatoes a message: http://greensock.com/forums/user/15167-ihatetomatoes/ Also here are the Docs to the staggerFromTo() method. http://greensock.com/docs/#/HTML5/GSAP/TimelineMax/staggerFromTo/ What s happening is you are only using 7 parameters in your staggerFromTo() method, when it accepts 9 parameters. It looks like you are passing onCompleteAllParams in the onCompleteAll parameter, which only accepts a function. You are also missing the position parameter! .staggerFromTo( targets:Array, duration:Number, fromVars:Object, toVars:Object, stagger:Number, position:*, onCompleteAll:Function, onCompleteAllParams:Array, onCompleteScope:* ) Parameters for staggerFromTo() and what you have as their parameter. targets:Array = $pixel duration:Number = 1 fromVars:Object = {autoAlpha: 0, cycle: { scale: ['0.5', '2'] } toVars:Object = {autoAlpha: 1, scale: '1', ease: Elastic.easeOut.config(1, 0.3)} stagger:Number = 0.3 position:* = pauseProjects onCompleteAll:Function = [projectClass] ( this should be a function not params for the function ) onCompleteAllParams:Array onCompleteScope:* It should be this: targets:Array = $pixel duration:Number = 1 fromVars:Object = {autoAlpha: 0, cycle: { scale: ['0.5', '2'] } toVars:Object = {autoAlpha: 1, scale: '1', ease: Elastic.easeOut.config(1, 0.3)} stagger:Number = 0.3 position:* = 0 ( add the position parameter ) onCompleteAll:Function = pauseProjects ( now this is a function ) onCompleteAllParams:Array [projectClass] onCompleteScope:* .staggerFromTo($pixel, 1, {autoAlpha: 0, cycle: { scale: ['0.5', '2'] }}, {autoAlpha: 1, scale: '1', ease: Elastic.easeOut.config(1, 0.3)}, 0.3, 0, pauseProjects, [projectClass]) .add('pixelsIn') Hope this helps! 4 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now