joshuua
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by joshuua
-
-
Hi there,
I'm using Svelte (SvelteKit specifically) and am running into an issue when using scrollTrigger with .from().
Seems like it's something to do with gsap not being able to detect what the destination values should be for the animations, to() works fine.
That said, Without scrollTrigger applied, the animation works ok.
The element just stays stuck at the values provided and doesn't animate. I have verified the trigger with `onEnter: () => console.log('check')`
Basic example:
<script> import gsap from 'gsap/dist/gsap.js'; import { ScrollTrigger } from 'gsap/dist/ScrollTrigger.js'; import { onMount } from 'svelte'; gsap.registerPlugin(ScrollTrigger); onMount(() => { gsap.from('#my-elem', { scrollTrigger: '#my-elem' x: 100 }); }); </script>
Svelte: ScrollTrigger and from()
in GSAP
Posted
Oh my.. Thanks for that @OSUblake, thought I was going crazy!
lazy: false
has indeed solved it for now.