Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
GSAP onComplete function doesn't fire when scrolling up

I'm using react-gsap and react-scrollmagic and am trying to fire a function when the animation completes. It works well when I scroll down, however, when I scroll up the function doesn't fire. I couldn't find any reference to this problem in react-gsap documentation. Is there any solution to this?

    <Controller>
      <Scene triggerHook={0} duration={duration} pin={{ pushFollowers: false }}>
        {(progress) => (
          <Timeline totalProgress={progress} target={<p>wohoo</p>}>
            <Tween
              from={{ opacity: "0" }}
              to={{ opacity: "1" }}
              onStart={() => console.log("Complete!")} // Works only when scrolling down
              onComplete={() => console.log("Complete!")} // Works only when scrolling down
            />
          </Timeline>
        )}
      </Scene>
    </Controller>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After hours of digging I found that I can use onReverseComplete callback function like so:

            <Tween
              from={{ opacity: "0" }}
              to={{ opacity: "1" }}
              onComplete={() => console.log("Complete!")} // Works when scrolling down
              onReverseComplete={()=>console.log("Complete!")} // Works when scrolling up
            />
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!