Jump to content
Search Community

ScrollTrigger Not Working When Used On An Allocated Timeline

emilychews

Recommended Posts

emilychews
Posted

Hi,

 

I'm just starting out with the new ScrollTrigger plugin and I can get it play ball with the gsap.to object, but can't seem to get it work if I use it with  var tl = gsap.timeline(); and then tl.to ?

 

Can you only use the scrollTrigger plugin on a `gsap` object ?
 

gsap.registerPlugin(ScrollTrigger);

// GSAP TIMELINE

var tl = gsap.timeline();

tl.to(".box-3", {
  scrollTrigger: ".box-3",
  duration: 3,
  opacity: 0.1
});


Many thanks,

Em

 

See the Pen PoZYYLM by emilychews (@emilychews) on CodePen.

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...