Jump to content
Search Community

Scrolltrigger based animation only works sometimes.

Supreme_Leader_Duck test
Moderator Tag

Recommended Posts

It works in the editor most of the times, but it doesn't work in the offline files. I have made a version with Vite with gsap installed. Doesn't work on repl.it even thought it's the same code. The animation works in the development version sometimes but fails to show up in the production version. It's just a simple scrollTrigger based animation that uses containerAnimation property to animate boxes. I'm sorry if this is a very noob question. Any help appreciated.

 

 

See the Pen rNYoWZJ?editors=0011 by AnxiousDuck (@AnxiousDuck) on CodePen

Link to comment
Share on other sites

Welcome  to the forums @Supreme_Leader_Duck

 

There is a known in regression in the current version that may affect .from() ScrollTrigger animations. It's fixed in the next release, but in the meantime try adding lazy: false to any .from() animations.

 

Ex...

gsap.from(e, {
  
    // try this
  	lazy: false,
  
    yPercent: -50,
    opacity: 0,  
    scrollTrigger: {
      containerAnimation: scrollTween,
      trigger: e,
      start: "left 80%",
      end: "left 40%",
      scrub: true,
    }
  })

 

  • Like 1
Link to comment
Share on other sites

4 minutes ago, OSUblake said:

Welcome  to the forums @Supreme_Leader_Duck

 

There is a known in regression in the current version that may affect .from() ScrollTrigger animations. It's fixed in the next release, but in the meantime try adding lazy: false to any .from() animations.

 

Ex...

gsap.from(e, {
  
    // try this
  	lazy: false,
  
    yPercent: -50,
    opacity: 0,  
    scrollTrigger: {
      containerAnimation: scrollTween,
      trigger: e,
      start: "left 80%",
      end: "left 40%",
      scrub: true,
    }
  })

 

This worked. Thanks a ton @OSUblake. I was racking my head over this for three days.

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