Class SmoothScroll<StaticProps, ChangeableProps, CallbacksTypes>

Smooth scrolling

Type Parameters

Hierarchy

  • Component<StaticProps, ChangeableProps, CallbacksTypes>
    • SmoothScroll

Implements

Constructors

Properties

_animationFrame: AnimationFrame

Animation frame

_clientHeight: number

Container height

_clientWidth: number

Container width

_container: HTMLElement

Scroll container

_disableDelayDebounce?: Timeout

_disable timeout

_elements: Elements
_frameIndex: number

Frame index

_isEqualLerp: boolean

Equal lerp for all elements

_isInstant?: boolean

If the approximation between the target and current scroll values must be instantaneous

_scrollHeight: number

Scroll height

_scrollLeft: number

scrollLeft

_scrollTop: number

scrollTop

_scrollWidth: number

Scroll width

_targetLeft: number

scrollLeft target value

_targetTop: number

scrollTop target value

_wrapperHeight: number

Wrapper height

_wrapperWidth: number

Wrapper width

Accessors

  • get isDestroyed(): boolean
  • The module is destroyed

    Returns boolean

  • get isInitialized(): boolean
  • The module is initialized

    Returns boolean

  • get props(): TRequiredModuleProp<StaticProps & ChangeableProps>
  • Current properties

    Returns TRequiredModuleProp<StaticProps & ChangeableProps>

  • get wrapper(): HTMLElement
  • Scroll wrapper. If the element does not exist indide the container, it will be created automatically

    Returns HTMLElement

Methods

  • Get Default properties (should be extended)

    Returns DeepRequired<StaticProps & ChangeableProps> & {
        animationFrame: boolean;
        container: string;
        direction: string;
        elements: boolean;
        hasStopPropagation: boolean;
        hasWheel: boolean;
        hasWillChange: boolean;
        isEnabled: boolean;
        isFpsNormalized: boolean;
        isInversedHandlerDirection: boolean;
        lerp: number;
        lerpApproximation: number;
        resizeDebounce: number;
        shouldAutoStop: boolean;
        translatePrecision: number;
        viewportTarget: string;
    }

  • Add a DOM event listener

    Type Parameters

    • El extends ListenerElement

    • Target extends keyof HTMLElementEventMap

    • Callback extends ((evt) => void)

    Parameters

    • el: El
    • target: Target
    • callback: Callback
    • Optional options: IAddEventListenerOptions

    Returns IAddEventListener