Jump to content
Search Community

DavidBrowne

Members
  • Posts

    4
  • Joined

  • Last visited

DavidBrowne's Achievements

  1. Thanks. I was overthinking it and had completely forgotton that 1 is for a delay.
  2. i'm struggling thinking this one through (or if it's even a problem that deserves solving ?, or just something that is going to happen regardless). I've created a simple horizontal scroll with Scrolltrigger, pinning the main container to keep it fixed while the user scrolls any number of sections. Works well, as i'm using the scrollwidth of the container, to make sure the entire container has moved across the viewport before the regular scroll kicks in again. However, it's not the perfect solution (if there such a thing) because if the user scrolls slightly quicker than average, especially when going back up. The normal scrolling kicks in before the transform has finished. 30 second loom just to show the problem - https://www.loom.com/share/c74ff7bdee874dcaa239823ce05df07e Is this just a built-in feature of pinning? I was expecting the transform to be matching the scroll position to the px, so it wouldn't matter about scroll speed. I can't think how to approach 'waiting for the transform to end' before allowing normal scroll, as obv that's not how the pinning is being implemented. Anyway not a huge issue, but if anybody can point me in the right direction. Not looking for a solution being given to me, (honestly don't put your time into it) just interested if there's a something I'm missing, I'm keen to learn. if it's going to take a huge effort, i'll just accept the issue as something that isn't worth solving.
  3. Ah, so simple. So it basically already does what I needed out of the box, I was just messing it up by adding the extra bit on the end that wasn't needed. Thanks alot.
  4. Hi, I'm trying to just do a add class when certain elements come into view, specifically when the top of these element hit the center of the viewport. So 'top center' as the start position. Works great, the issue is if one of the target elements is already positioned above the center of the viewport when the page loads, or is near the center of the viewport, the adding of the class is never triggered or only sometimes triggered, but I need to be. (view the codepen full screen to force the top item to be at the top of the viewport to see what i mean) short vid to show what i mean - https://www.loom.com/share/65bad6abdf224d2eb6595e0a76a0fbd1 (notice the third item seems to behave unpredictably, due to where it is positioned on the page when it loads) I wondering if there's a better way to approach this, I really just need it so that any of these elements that is above the center of the viewport should have the active class, anything below does not. Is there something built into scrolltrigger that covers this? or if it's just a case of needing to add some extra JS outside of the scroll trigger function to work out the starting positions and add the class seperately?
×
×
  • Create New...