"options" is an Array of elements and "new" is the ID of the first (index = 0) element. Different settings should be applied to #new.
The error I get says there is something wrong with the trigger, but I can't figure out what. I am certain that I'm not missing a plugin because I tried writing the same code differently like this:
ScrollTrigger (Invalid property ScrollTrigger set to [...] Missing plugin? gsap.registerPlugin())
in GSAP
Posted
Hi,
I was trying to create an animation using ScrollTrigger but is says that the element I set as trigger is not allowed. Here is how I wrote my code:
"options" is an Array of elements and "new" is the ID of the first (index = 0) element. Different settings should be applied to #new.
The error I get says there is something wrong with the trigger, but I can't figure out what. I am certain that I'm not missing a plugin because I tried writing the same code differently like this:
and this version works perfectly fine. It wouldn't have if I was missing a plugin.
Can someone tell me why the second version works and the first one does not?
The design is for mobile, so decrease your browser window's width if it didn't look good.
See the Pen jOmrrrb by Arman151 (@Arman151) on CodePen