scrollerProxy
to sync GSAP with Locomotive’s virtual scroll container.ScrollTrigger.refresh()
after setup.When integrating Locomotive Scroll with GSAP animations, they can conflict because Locomotive hijacks scroll behavior—which disrupts how GSAP detects scroll position using native browser events.
scrollerProxy
method to tell GSAP to follow Locomotive’s virtual scrolling.data-scroll-container
):ScrollTrigger.scrollerProxy()
to define how ScrollTrigger queries scroll offset.Example adjustments:
window
with your scroll container element when setting up ScrollTrigger.load
event or place scripts in the site-wide Before tag area in Project Settings to prevent DOM selection issues.
ScrollTrigger.refresh()
after your Locomotive Scroll setup to ensure proper positioning and triggering of animations.window.scrollY > 100
), replace it with a listener tied to Locomotive’s scroll
event:scroll.on('scroll', obj => { /* check obj.scroll.y */ })
To make your GSAP navbar scroll animations work with Locomotive Scroll in Webflow, you need to set up GSAP’s scrollerProxy
to integrate with Locomotive's virtual scroll and adjust any direct scroll triggers to use Locomotive’s scroll event system. Ensure you refresh ScrollTrigger post-init and migrate from native window.scroll
detection to Locomotive's scroll coordinates.