Jump to content


Callback parameter vars wont work on TweenMax

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

Hey forums.


Iv'e run into an issue when passing data into a scroll event listener to fire a callback with preset variables.


The settings.in.func callback fires repeatedly instead of once and the vars object wont be accpeted in the TweenMax vars parameter.


The Code pen link provides this behavior when scrolling down.  

See the Pen xOZYYr by joshscorrar (@joshscorrar) on CodePen

Link to comment
Share on other sites

Hey joshscorrar,


By golly that's a lot of ifs... ;)


I don't know what you are trying to achieve but I did manage to track down where your code is breaking. Thanks for the Pen, it would have been impossible otherwise.


You're not targeting the right bits when calling TweenMax:

TweenMax.to(eData.targetElm, eData.settings.in.dur, eData.settings.in);
// According to your object structure it should be something like the bellow
TweenMax.to(eData.targetElm[0], eData.settings.in.dur, eData.settings.in.vars);
  • Like 2
Link to comment
Share on other sites

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.