Jump to content
Search Community

Variables in ScrollTrigger

Lauritz Offe test
Moderator Tag

Recommended Posts

Hi,

for my Projekt in TYPO3 I need to use variables in my Animation / ScrollTrigger .

 

Somethin like that...
 

var myid1 = somefunction1

var myid2 = somefunction2

 

ScrollTrigger.create({  

trigger: '#step-2',  

start: 'top center',  

onEnter: myid1,  

onLeaveBack: myid2,  

markers: false,  

id: 'second-box' });

 

Is this even possible?
I don´t need to change the variables  on the fly.

 

Thanks in advance

Lauritz Offe

Link to comment
Share on other sites

I'm not sure if you meant that as a question, @Lauritz Offe. If so, no, it wouldn't make sense to use function-based values to function-based values :) In other words, how would ScrollTrigger know that the function you're passing it is the actual onEnter that should be called or just a function that's to be called in order to get the real onEnter function? 

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.
×
×
  • Create New...