Socket
Socket
Sign inDemoInstall

scroll-smooth

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    scroll-smooth

Scroll with _smooth_ gestures


Version published
Weekly downloads
49K
decreased by-1.67%
Maintainers
1
Install size
66.6 kB
Created
Weekly downloads
 

Readme

Source

scroll-smooth

Scroll with smooth gestures

### API

/**
 * Simple 
 */
scrollSmooth.to(elem|position)

// like
scrollSmooth.to(document.querySelector('.myElem'))
// or 
scrollSmooth.to(700)

/**
 * With Options
 */
scrollSmooth.to(elem|position, {
  duration,
  context,
  offset,
  ease,
  callback,
})

// like
scrollSmooth.to(document.querySelector('.myElem'), {
  duration: 1500
  offset: 100,
  callback: elem => console.log(`Yup! Hi ${elem}!`),
})

// or 
scrollSmooth.to(document.querySelector('.another'), {
  context: document.querySelector('.parent')
  callback: elem => console.log(`Yup! ${elem} inside a context different than window!`),
})

Keywords

FAQs

Last updated on 25 Jan 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc