Skip to content

Callback after scrolling ends #6

@macieklamberski

Description

@macieklamberski

Hi! It would be nice to have ability to specify function called after scrolling is finished. Below are two examples how it could be tackled.

import { scrollTo } from 'scrollyo'

const el = document.querySelector('...')

// callback only for end event
scrollTo(el, 500, () => {
  console.log('scrolling is finished!')
})

// or open ability to specify multiple options
scrollTo(el, 500, {
  started() {
    console.log('scrolling has started!')
  },
  ended() {
    console.log('scrolling is finished!')
  },
  easing: 'ease-in', // it could even be open for various types of easing
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions