Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Search the Community

Showing results for tags 'scrolltrigger'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge


  • FAQ Landing Page


  • Examples
  • Showcase


  • Products
  • Plugins


  • Learning Center
  • Blog


  • ScrollTrigger Demos


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Personal Website



Company Website



  1. Banging my head a bit. I've got a few Scroll Trigger based animations on the home page of a site and it works flawlessly when in local development. It isn't until we've deployed to a production/staging environment does it break. Effectively what's happening is when we load the site on production/staging all animations run immediately. Not sure if its a component mounting issue (which would mean its not a GSAP issue) or if something is being compiled/computed differently in a live environment? Each section is setup as follows: 1. Define the animation/scroll trigger in the `mount` lifecycle hook 2. Use `$refs` to pass elements into the animation. <template> <div id="vid-container" class="h-screen w-screen bg-white"> <video @loadeddata="loaded" class="w-full fixed inset-0 duration-500 transition-opacity opacity-0" :class="{'opacity-100': videoLoaded}" src="https://player.vimeo.com/external/611257045.hd.mp4?s=785a9d52ed5d188f762436b1bb618493f784d3f5&profile_id=174" autoplay loop muted preload></video> <svg ref="mask" class="mask absolute w-full h-full" > <mask id="mask"> <rect width="100%" height="100%" fill="white"></rect> <text font-family="Bagnard, serif" font-weight="500" x="50%" y="49%" class="origin-center " text-anchor="middle" transform="scale(15)" > <tspan x="50%">Freelance</tspan> <tspan x="50%" dy="1em">Founders</tspan> <tspan style="font-size: .5rem" x="50%" dy="2em"> ↓ </tspan> </text> </mask> <rect id="bg" width="100%" height="100%" fill="#fff"></rect> </svg> </div> </template> <script> import { gsap } from "gsap"; import { ScrollTrigger } from "gsap/ScrollTrigger"; import { CSSRulePlugin } from "gsap/CSSRulePlugin"; if (process.client) { gsap.registerPlugin(ScrollTrigger, CSSRulePlugin); } export default { data() { return { videoLoaded: false, } }, mounted() { console.log('hero mounted') let width = window.innerWidth let speed = 350 //pixels per second let endX = width let duration = endX / speed let ease = "sine.inOut" let intro = ''; if (this.$refs.mask) { this.$nextTick(() => { intro = gsap.timeline({ onComplete: () => {}, scrollTrigger:{ trigger: this.$refs.mask, start: "bottom 100%", end: "bottom 50%", pin: true, scrub: true } }); intro.to(this.$refs.mask, { scale: 5, opacity: 0, duration: 5, ease: ease }, 'intro') } ) } }, methods: { loaded() { this.videoLoaded = true; } } } </script> Staging link example: https://freelance-founders-hgc9zjyrf-progresslabs.vercel.app/ FYI - Working on a minimal example to post here shortly.
  2. Hi! How can i specify for each element start position from center block (not elements wrapper) if elements has `absolute` position I try: elements.forEach(e=>{ gsap.to(e, { ... scrollTrigger: { start: e.offsetTop, // i try ()=>return `top+=${e.offsetTop} bottom` but does't work end: "max", invalidateOnRefresh: true, scrub: 0, markers: true } }) } but see that its work slowly Can i do the same without .forEach
  3. Hi, I've been using gsap and multiple plugins over the last couple weeks. For the most part I've found my way around but been stuck on this for the past day. The pen is a minimized version of what I'm trying to achieve, which is a pinned panel that rolls through 7 sections (all full-screen), and some of the panels have a lottie animation tied to it via ScrollTrigger. I got the panel to work, but tweaking timings is getting complicated, which I'm trying to solve via using a master timeline so the timings are contained. The timeline bit seems to work but I can't seem to get lottie to fire up correctly. Also any pointers on the rest of the code is appreciated as I'm sure there's a lot to be improved. Thanks in advance
  4. In the given like you can see that the scroll animation gets stuck for ios. Working fine of android. Below is my code. Here is the site link : https://animationstest.vercel.app/work I am also attaching the video for your reference : useEffect(() => { gsap.registerPlugin(ScrollTrigger); const boxes = gsap.utils.toArray('.Work-info'); boxes.forEach(box => { gsap.from(box, { scrollTrigger: box, y: 100, duration: 1.2, opacity: 0, }); }); }, []);
  5. Hi I am new to gsap and I am unable to achieve what I want using scrollTrigger . I want the article that is not on page to revel animation on scroll but it gets finished with other animations. I already saw Most Common ScrollTrigger Mistakes but didn't got the answer that I wanted. Below is the code and video sample const Aboutpg = gsap.timeline({ delay: 0.5, ease: 'power4.out' }); Aboutpg.from('.aboutme h1', { y: 200, duration: 0.8, opacity: 0, skewY: 10, }); Aboutpg.from('.aboutme article', { scrollTrigger: '.aboutme article', y: 150, duration: 0.8, opacity: 0, stagger: 0.2, skewY: 10, }); Untitled.mp4
  6. Im using GSAP ScrollTriggers to animate stuff in when they enter the viewport. Right now im using ScrollTrigger.batch to stagger animations inside my footer. It works somewhat fine. but the triggers them self seem kinda random. When i have markers turned on, they for the most part seem to work as intended. But only because the markers extend the bottom margin of the footer and there by extend the height of the page. But sometimes, the markers end up above the footer, and trigger the animations before they are in the view port. If i turn off the markers the most common result is the same as above. they get triggered before they are in the view port. with the added bonus, that the last elements, the links, dont trigger at all. I also recently discovered that on bigger screens, it seems to work fine. I was wondering if it is possible to set the footer tag it self as the trigger so that when it enters the viewport, it triggers the staggered animation of the span elements. How would I go about doing that? Thank you in advance for the help
  7. Hi everyone, I am new to GSAP. trying to create a Shrinking header animation. I am trying to reduce the height of 1st section (Faded yellow) using scrollTrigger . But the issue is second section(Blue section) is hiding behind the 1st section on scroll..
  8. Hey guys, I'm having some trouble on something this evening, was wondering if you guys could help. Given that this uses a 3d model, I can't attach a codepen unfortunately. But I'll do the best to include all relevant code snippets and give all the details I can. I've been working on a website that uses scroll trigger to move content around, and also to move around this 3D car model that I have. I have 4 different slides, and for the sake of simplicity, I've gone ahead and recoloured them. Slide 1: Blue, start slide Slide 2: Pink, slides in from the right Slide 3: Yellow, slides in from bottom Slide 4: Green, slides in from the right Now Slide 4 is the main culprit, I'm trying to move this car around to have the car in the 4th slide look like the image below: However, the transition to the image is a little less than sleek. I've attached a video of how the transitions currently look, scrolling between these different slides. Ignore the music, I just recorded this very quickly on my ShadowPlay. Now let's talk about the code I've got. I'm trying to use ScrollTrigger to move between all of these, and I created a variable for a timeline just so I could keep it all in check (or so I thought). Here's what I have thusfar. scene.rotation.set(0, 9.8, 0) camera.position.set(-1.2,0,5) let car_anim = gsap.timeline() // Slide 2 car_anim.to(scene.rotation, {y: 4.79, easing: Power1.easeInOut, scrollTrigger: { trigger: "#slide2", scrub: 1, }}, 0) car_anim.to(camera.position, {x: -0.1, easing: Power1.easeInOut, scrollTrigger: { trigger: "#slide2", scrub: 1, start: "right right" }}, 0) // Slide 3 car_anim.to(scene.rotation, {z: 1.6, easing: Power1.easeInOut, scrollTrigger: { trigger: "#slide3", scrub: 1, start: "top top" }}, 0) // Slide 4 - The problem child car_anim.to(scene.rotation, {z: 0.02, y: 3.1, easing: Power1.easeInOut, scrollTrigger: { trigger: "#slide4", scrub: 1, start: "right+=2500 right" }}, 0) car_anim.to(camera.position, {x: 0.16, easing: Power1.easeInOut, scrollTrigger: { trigger: "#slide4", scrub: 1, start: "right+=2500 right" }}) I start out with setting a base camera position and scene position. The scene position refers to the car, and the camera just refers to the camera. The first three slides work well. I have another video somewhere of all of those working just fine. I'm just having trouble of smoothly continuing the movements of the car. It's not a ThreeJS issue I don't think. I'm pretty sure it's just the start of the scroll trigger, given that the other ones have worked fine. I guess it's as I've started making more complex movements. So yeah, how do you think I could get these working at all? I'm not entirely sure what I'm doing wrong to be very honest with you. Thanks in advance, and sorry for the lack of codepen - it's a little hard to do with all the technical set up. UPDATE: Just an edit after I've played around with it a bit more. I think it's becoming less and less of a gsap issue, but I'll keep this thread up in case anyone else knows how to solve it / it can be used as a future reference. It seems as if when I modify a different axis more than once (i.e. the y-axis), it updates the value weirdly. I don't have console log proof, but I messed around with the 4th slide and it seems to transition fine when I set it to affect the x-axis - a property that has yet to be used with the scene rotation.
  9. Hello, I would like some advice on my current issue, here is my requirements for my issue: the #section2 needs to be ScrollTriggered each animation from span/h2, each scramble needs to be finished on scroll, not stopping while there is scrambled text (sometimes you scroll a bit and it stops on some scrambled text) each span/h2 needs also to be ScrollTriggered, so each animation needs to be finished (forcibly?) before it trigger the following span/h2 on the following staggered element (1st span animate, stops. Scroll wheel, 2nd span animate. Quick scroll wheel, following animation quickly animates) It also needs to be pinned until the whole timeline is finished. Hope you guys can help me with this issue, thank you very much!
  10. Hey there folks! I just started exploring with GSAP in a new project and absolutely fell in love with the capabilities this library offers.It was going all good till i ran into a problem with the Scrolltrigger setup. So i am currently working on a nextjs single route project where the page is sectioned (components) in different parts and has navigation to scroll up and down on the page. I am using scrollTrigger to mark active nav based on which section is visible. There is one sections with two components (one Component for mobile view and the other for bigger screen) which is loaded based one screen size which is causing the problem, when initially the page loads it works fine but when resizing the window and mobile view component loads its scrollTrigger its Start position locks on top of the document even after refresh(). i tried my best to troubleshoot the problem in different ways. For other sections i used Scrolltrigger.matchMedia() to load different scrolltrigger position for different screen size and it works for other sections, this particular section is loaded conditionally and that's causing the glitch, and i'm not sure how to fix this. Demo Link: https://codesandbox.io/s/scrolltriger-navigation-to5kn?file=/src/App.js
  11. Hello community , how we can apply scroll trigger for img from data base in foreach this is the images div from database <div><img src="{{$app->image_path}}" class="flower" alt="image" ></div> then this is the gsap part , but it fire the trigger for all image in the same time gsap.from(".flower", { rotateX: -80, ease: "expo.out", transformOrigin: "50% 100%", scrollTrigger: { trigger: '.flower', pin: true, start: 'top top', end: 'top center', scrub: 1, } });
  12. Hello everybody, I would like to make an action on each post of a blog when they enter the viewport. i did the following, but the event is fired on all elements with the .blog-item class, i would like to be fired only when each blog-item element enter the viewport, could it be possible to pass something like "this" in jQuery from the ScrollTrigger? Thanks all. let articles = gsap.utils.toArray($(".blog-item > *")); ScrollTrigger.create({ start: "bottom bottom", trigger: ".blog-item", onEnter: articleApparition }); function articleApparition() { let init= 1; articles.forEach(function(section){ let delais = init * 0.7; gsap.to(section, { opacity:1, duration:2, delay: delais, ease:"power1.out" }); init++ }); }
  13. I created this basic horizontal scroll website and my problem is when my Section Width is more than 100vw its not working properly, i want all section should be visible and scrollable. Thank you.
  14. Hello everyone! I express my deep gratitude to the community. There is a problem when objects disappear and appear while scrolling (banner-big children). How can I fix this?
  15. Every time I leave the page the position of the "Start and End trigger" refresh and change position according to Viewport I guess... Can this be changed so that it stays in the same position?
  16. ScrollTrigger not working within module using Chrome... though works as expected with npm on local server. I have read articles previously recommended by OSUblake about importing modules. Noting also the plugin is registered. Have also tried within the Body Script on a Wordpress page but same issue persists. Final production script needs to be within the Body Script on a Wordpress page. So, seems issue might be how the sketch variable is assigned to the object and then called within onUpdate in the timeline?
  17. if the Viewport is bigger, then the "animtion1" element won’t disappear from screen. Can I for example use a percent sign like this ( X: -100%) this is my code bellow gsap.registerPlugin(ScrollTrigger); gsap.to(".animation1", { x: -860, duration: 12, scrollTrigger: { pin: true, trigger: ".animation1", markers: { startColor: "blue", endColor: "purple", fontSize: "1rem", }, start: "100% center", end: "200% 30%", scrub: 2 } });
  18. I followed the solution by OSUblake on how to use imports as a CDN within <script type="module"> to import GSAP. I also added the required registration of gsap.registerPlugin(ScrollTrigger); but console error states that ScrollTrigger is undefined. I did not find any reference on skypack.dev on how to separately import ScrollTrigger plugin. Does the cdn import from skypack.dev for GSAP also include ScrollTrigger or does it need to be imported separately ?
  19. Hello community! I can't figure out how to replay tween after main ScrollTrigger. In the Codepen I have an example, on the first scroll end there is a beam, but if you scroll up again and try to get the same animation (after ScrollTrigger ends), it doesn't replay. I've tried to clear animation inside onComplete like onComplete: () => { circleTl.time(0).kill() } But no luck. How to solve that? Thanks!
  20. Hi, I am having some problems with scrollTrigger, I am trying to create a timeline wich is going to trigger when a section gets into the viewport and is going to animate some content wich is inside that section, such as headings and texts, the problem comes when I try to repeat my classes, all the sections are going to have the same class( I know for doing this I shoud use something like gsap.utils.toArray() and loop through the sections) but, what about the content inside the sections wich I want to animate? should I use different classes to each heading and text? or is there a better approach? I am going adjunt a codepen of what I tried to do. Thank you so much.
  21. Hey guys, I'm running into problems when i scroll down or up too quickly. It must be something quite simple, I'm missing. If you scroll down slow, then box 1 appears, and then as you go further down, box-2 appears. But if you scroll down quickly, past both triggers, box 1 doesn't disappear quick enough and all the boxes appear on top of each other. I'm using fromTo's and I've tried "immediate render: false" and "overwrite" but, have not been able to work out what is causing this issue. Hope that all made sense. I've made a minimal codepen demo to show what's going on. Any help is greatly appreciated. Cheers
  22. Hello everyone, This is a reformulation of a topic that I created a few days ago. I am creating a new one here because I think it is more a ScrollTrigger+React-related problem and that it might benefit from being referenced as such. Context There are two consecutive "sections" that are both a 100vw/100vh. Each section is a React component (in the CodeSandbox below, they're called respectively WorkOverview and HomeAbout). They both get pinned one after the other. Problem The second element gets pinned too early, exactly as if the padding of the first section's .pin-spacer wasn't taken into account. The weirdest thing is that it doesn't happen all the time (but must of the time). Please note that (1) the ScrollTriggers are created in the order they happen on the page and that (2) it is not caused by any asynchronously-loaded content on what the sections' sizing might rely (images are inside a pre-sized container). Here's a video that illustrate the problem: Here's the CodeSandbox link https://codesandbox.io/s/clever-rhodes-16ic1. Note: if you don't see the problem, refresh the page 1 or 2 times. Thanks in advance for you precious help!
  23. GreenSock


    Scroll-driven animations re-invented Animate anything on scroll DOM, CSS, SVG, WebGL, Canvas, whatever. Toggle playback state or scrub through animations Entering or leaving a ScrollTrigger area can make an animation play, pause, resume, reverse, restart, or complete...or you can make the scrollbar can act like a scrubber! Pin elements in place Make an element appear immune to scroll changes while the ScrollTrigger is active. This is surprisingly useful for creating slick effects and keeping your animation in view during the scroll. Insane levels of flexibility ScrollTrigger is a control freak's dream when it comes to choreographing animations, but its rich callback system also lets you accomplish things totally unrelated to animation. Directionally smart ScrollTrigger supports vertical and horizontal scrolling, and lets you check if the last scroll movement was forward or backward, and even tracks velocity! Automatic resizing ScrollTrigger elegantly adjusts to viewport size changes. You can even use function-based start/end values to run custom logic or tap into fancy responsive CSS changes. Maximum performance ScrollTrigger uses all kinds of techniques to maximize performance like throttling updates, pre-calculating intersection points to minimize effort during scroll, leveraging transforms, layerizing elements to utilize the GPU, etc. Integrated with GSAP ScrollTrigger is built on GSAP, the battle-tested standard for JavaScript animation that's used on over 10,000,000 sites worldwide including most award-winning ones. Get started with ScrollTrigger Download Documentation Examples Featured ScrollTrigger demos View all demos
  24. Hello, So i used the ScrollTrigger skew example to tilt the three js camera instead the image skew property. Apart from that, a text div is being translated and sphereGroup is being rotated using gsap value & it is working nicely The problems i face with velocity are: 1 ) there is no smoothing happening when going to the calculated position 2) the above problem also leads to jerk when scroll direction is switched it 3) with mouse wheel the the incremental jumps does not look nice (which could also be solved with better smoothing maybe?) any tips ? suggestions for better gsap to three logic also welcome last function in codpen has all the gsap properties
  25. Hello, I'm really excited to get the opportunity to work with gsap! I'm currently having an issue with reusing the same gsap function for multiple elements. My goal is, that each box-container gets triggered individually when they come into the viewport. Currently, the animation function is only applied to the first box-container, which is also the only one that has gotten a scrollTrigger marker applied to it. What I want however, is that each bock-container gets their own markers and is triggered individually. To me, my demo really makes sense but it's obviously not achieving what I need. I would really appreciate if someone could explain to me where I went wrong ^^ Thanks! Edit: I've changed the animations from when I first posted, but I added some comments to the codepen for later viewers that might experience the same problem to see the progression.