Search results
Shows how to use Locomotive Scroll with ScrollTrigger...
gsap.registerPlugin(ScrollTrigger); // Using Locomotive Scroll const locoScroll = new LocomotiveScroll({ el: document.querySelector(".smooth-scroll"), smooth: true }); // each time Locomotive Scroll updates, tell ScrollTrigger to update too (sync positioning) locoScroll.on("scroll", ScrollTrigger.update); // tell ScrollTrigger to use these ...
// Using Locomotive Scroll from Locomotive https://github.com/locomotivemtl/locomotive-scroll: const locoScroll = new LocomotiveScroll({el: document.querySelector(".smooth-scroll"), smooth: true}); // each time Locomotive Scroll updates, tell ScrollTrigger to update too (sync positioning) locoScroll.on("scroll", ScrollTrigger.update);
Jul 5, 2020 · I've reviewed the codepen solution for Locomotive / ScrollTrigger Integration ( See the Pen 1dc38ca14811bc76e25c4b8c686b653d by GreenSock on CodePen), but am having difficulty implementing a simple ScrollTrigger animation in my own case. In the attached example, I'm trying to apply a simple fade to the images on scroll.
Nov 5, 2024 · Locomotive + ScrollTrigger. Raw. locomotive.js. function loco () { gsap.registerPlugin (ScrollTrigger); // Using Locomotive Scroll from Locomotive https://github.com/locomotivemtl/locomotive-scroll. const locoScroll = new LocomotiveScroll ( { el: document.querySelector ("#main"), smooth: true. });
Sep 3, 2024 · var chck_if_sfe_loco_scroll_loaded = setInterval(function() {. if (window.sfe_loco_scroll && Object.keys(window.sfe_loco_scroll).length !== 0 && window.gsap && window.ScrollTrigger) {. // store locomitive scroll object for the local usage. loco_scroll = window.sfe_loco_scroll; // register scrollTrigger.
This is an example of how to implement combined horizontal and vertical scrolling using Locomotive Scroll v5 and GSAP ScrollTrigger in Next.js. It is based on the this codepen, which works for version 4: https://codepen.io/akapowl/pen/wvJroYy.
May 22, 2024 · If you're looking for ScrollTrigger effects, I'd recommend looking at the demos at https://codepen.io/collection/DkvGzg and https://codepen.io/collection/AEbkkJ - you may be able to use one of those as a jumping-off point.
gsap.registerPlugin(ScrollTrigger); // Using Locomotive Scroll from Locomotive https://github.com/locomotivemtl/locomotive-scroll const locoScroll = new LocomotiveScroll({ el: document.querySelector(".smooth"), smooth: true, //smoothMobile: true smartphone: { smooth: true }, tablet: { smooth: true }, }); // each time Locomotive Scroll updates ...
import LocomotiveScroll from 'locomotive-scroll'; const scroll = new LocomotiveScroll({ el: document.querySelector('[data-scroll-container]'), smooth: true }); Note: scroll-sections are optional but recommended to improve performance, particularly in long pages.