Capítulo 313 de 411
added in v3.10.0
data-speed attribute on any element, like data-speed="0.5" would make that element "scroll" at half-speed while it's in the viewport. It arrives at its normal position in the document flow when it's centered vertically.overflow: hidden and then set the child's data-speed="auto" and it'll automatically calculate exactly how far it can move inside that container (parallax).data-lag attribute, like data-lag="0.5" would take 0.5 seconds to "catch up".normalizeScroll: true feature prevents [most] mobile browser address bars from hiding/showing (resizing the viewport), stops overscroll behavior, and solves multi-thread synchronization challenges!normalizeScroll: true to avoid common problems like the hiding/showing of the address bar on mobile browsers, plus it'll work around iOS Safari bugs that occasionally cause jitter. See ScrollTrigger.normalizeScroll() for details.gsap.registerPlugin(ScrollSmoother)
| #### .progress : Number | The progress value of the overall page scroll where 0 is at the very top and 1 is at the very bottom and 0.5 is halfway scrolled. This value will animate during the smooth scrolling and end when the onStop fires. |
| #### .scrollTrigger : ScrollTrigger | The ScrollTrigger instance that ScrollSmoother created internally to manage the smooth scrolling effect of the page. |
| #### .vars : Object | The configuration object passed into the ScrollSmoother.create() initially. |
| #### .content( element:String | Element ) : Element | self | Gets/Sets the content element. |
| #### .effects( targets:String | Element | Array, config:Object | null ) : Array | Adds parallax elements that should be managed by the ScrollSmoother |
| #### .getVelocity( ) : Number | Returns the current velocity of the smoothed scroll in pixels-per-second |
| #### .kill( ) ; | Kills the entire ScrollSmoother as well as any effects that were applied. |
| #### .offset( target:String | Element, position:String ) : Number | Calculates the numeric offset (scroll position in pixels) that corresponds to when a particular element reaches the specified position like: |
| #### .paused( pause:Boolean ) : Boolean | self | Gets/Sets the paused state - if true, nothing will scroll (except via scrollTop() or scrollTo() on this instance). |
| #### .scrollTo( target:Number | String | Element, smooth:Boolean, position:String ) ; | Scrolls to a particular position or element |
| #### .scrollTop( position:Number ) : Number | void | Immediately gets/sets the scroll position (in pixels). |
| #### .smooth( duration:Number ) : Number | self | Gets/Sets the number of seconds it takes to catch up to the scroll position (smoothing). |
| #### ScrollSmoother.create( ) ; | |
| #### ScrollSmoother.get( ) : ScrollSmoother | Returns the ScrollSmoother instance (if one has been created). There can only be one instance at any given time. |
| #### .wrapper( element:String | Element ) : Element | self | Gets/Sets the wrapper element. |
data-speed attribute on any element, like data-speed="0.5" would make that element "scroll" at…overflow: hidden and then set the child's data-speed="auto" and it'll…