Jump to content
Search Community

hybrid09

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by hybrid09

  1. On 8/28/2020 at 6:24 PM, ZachSaucier said:

    ScrollTrigger has a toggleClass functionality that adds a class when entering/exit. So you could change your CSS to have an enable class (instead of a disable one) and then use toggleClass:

    
    const buttons = gsap.utils.toArray('.btn');
    buttons.forEach((btn) => {
      gsap.from(btn, {
        scrollTrigger: {
          start: 'top bottom',
          end: 'bottom top',
          trigger: btn,
          toggleClass: 'enable'
        }
      });
    });

    But if you need to keep disable then what you have is good (other than your syntax errors - it should be onEnter: () => { } for example).

    Hey Zach, 

     

    Is there anyway for me to increase the time/distance between the scrolltriggers? The buttons are scrolling one after another and I would like there to be some time gap after each button. 

     

    I made a small demo: 

    See the Pen ExgvBzW by mallabiplav (@mallabiplav) on CodePen

  2. Hello everyone, 

     

    Lets say I have a full page, and I have a panel inside it with margins of 2em each. I have two panels inside that use scroll triggers. I would like the panel to maintain all margins, how do I go about creating that? In the first picture below, the red is the margin I want to maintain with the left and right panels being able to be pinned. 

     

    The second picture is what I am facing, the margins on top and bottom are not maintained when left and right panels are pinned. 

     

    image.thumb.png.28320fc50b102a986aa0e2774a688a60.png

     

     

    image.thumb.png.4f2f97458c4cdc164b6a8c1ee5391957.png

    See the Pen ZEpGZpv?editors=0110 by mallabiplav (@mallabiplav) on CodePen

  3. On 11/26/2020 at 5:36 AM, GreenSock said:

    I'm not sure I understand the desired effect. Based on your code, it seems to be doing what you're asking, but I'm sure I'm misunderstanding something. A few quick notes: 

    1. You're making one of the most common mistakes by not setting all your transforms via GSAP.  I'd add gsap.set(".section3", {yPercent: -100, y: 0});
    2. You're using mis-matched versions of GSAP and ScrollTrigger. I'd definitely recommend using the latest of each. 

    So are you saying that you only want the left box to stay pinned while scrolling? And it should stop being pinned when its bottom reaches the bottom of the box on the right (the taller one)?  And how do you expect the transition to be timed with that? Is panel3 getting revealed WHILE the left box is pinned but the right one is scrolling past the whole time? 

     

    @GreenSock I read the post and even then completely missed the note. This was my bad. That seemed to have been the problem that was messing with the scroll trigger. 

  4. Hey everyone,

     

    I'm trying to accomplish a simple pinning, it worked initially but after I tried to add a reveal panel the pinning shows weird behavior (will not pin).

    After section 3 reveals itself from underneath section 2, I would like the left box to pin itself. This is a basic snippet that I created from my actual project. The pinning and everything else worked fine without the reveal. 

     

    Thank you.

    See the Pen VwKZBvN by mallabiplav (@mallabiplav) on CodePen

  5. Hello everyone, 

     

    I am new to GSAP and have been playing around with it, I have been trying to make a slideshow kind of thing on scroll where I pin a sidebar and the other side has a changing paragraph/heading. I am using flex with two divs inside and pinning the left one. When my scroll trigger hits and pins the left div, the size of the right one changes. 

     

    Help would be appreciated. 

    See the Pen jOrREoL by mallabiplav (@mallabiplav) on CodePen

×
×
  • Create New...