Jump to content
Search Community

Vineeth Achari

Members
  • Posts

    40
  • Joined

  • Last visited

Posts posted by Vineeth Achari

  1. 19 hours ago, elegantseagulls said:

    Hi @Vineeth Achari,

     

    You shouldn't need to manually add a height in to #smooth-content. If you have a pin: true ScrollTrigger animation with an end: '+=4000' that should automatically add that height you're looking for without overlapping or creating any weird gaps at the bottom.

     

    Hi ,

     

    Have updated with 'pin' 'end' etc. Still extra height is there...

     

    Here's the code for your reference.

    // JavaScript Document
    gsap.registerPlugin(ScrollTrigger, ScrollSmoother);

    // create the smooth scroller FIRST!
    let smoother = ScrollSmoother.create({
      smooth: 2,   // seconds it takes to "catch up" to native scroll position
      effects: true, // look for data-speed and data-lag attributes on elements and animate accordingly
      smoothTouch: 0.1,
      normalizeScroll: true,
      ignoreMobileResize: true,
      pin: true,
      end: '+=4000'
    });

  2. 17 hours ago, Shaun Gorneau said:

    HI @Vineeth Achari,

     

    The example provided at hugeinc.com is pretty straight forward. At a basic level, you'll want to either kill the default scroll behavior, or contain everything in a parent element that has a height/width of 100% and overflow hidden. Then, whenever the scroll delta meets a minimum threshold, you can fire off a GSAP tween to move (tween the `y` property) of the stacked elements (each of those are also width/height 100% inside the container), -/+ the height of the a panel element.

     

    You'll want to detect if the user is at scrollTop 0 before allowing a tween +y to (reverse) ... and also determine if the scrollTop is at its limit (  panel height * (number of panels - 1 ) ) before allowing any advance (forward).

     

    Hope this helps.

     

    Shaun

    Thanks Shaun.

×
×
  • Create New...