Erik_
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by Erik_
-
-
How to reset ScrollTrigger animation start/end positions after a change in another element's height?
I have a large heading that a smaller heading animates over on scroll both above and below an image that can be resized. When the image is resized the ScrollTriggers for the headings below the image are not recalculated. (They are if the window is resized.)
I tried
ScrollTrigger.refresh(true)
with and without adding true, but that does not work.Using setTimeout works, but is that the correct way to solve the problem?
setTimeout(() => {
console.log("refreshing")
ScrollTrigger.refresh(true)
}, 500)See the Pen LYexeam?editors=0111 by EOJA (@EOJA) on CodePen
How to reset Scrolltrigger animation start/end positions after a change in another element's height?
in GSAP
Posted
@GreenSock Thanks, that was the problem.