Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scroll-smooth

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll-smooth

Scroll with _smooth_ gestures

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 25 Jan 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc