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

scroll

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll - npm Package Compare versions

Comparing version 2.0.3 to 3.0.0

LICENSE

11

index.js

@@ -1,2 +0,1 @@

var raf = require('rafl')
var E_NOSCROLL = new Error('Element already at target scroll position')

@@ -26,3 +25,3 @@ var E_CANCELLED = new Error('Scroll cancelled')

cb(E_NOSCROLL, el[prop]) :
raf(animate), cancel
requestAnimationFrame(animate), cancel

@@ -42,5 +41,7 @@ function cancel () {

time < 1 ? raf(animate) : raf(function () {
cb(null, el[prop])
})
time < 1 ?
requestAnimationFrame(animate) :
requestAnimationFrame(function () {
cb(null, el[prop])
})
}

@@ -47,0 +48,0 @@ }

{
"name": "scroll",
"author": "Michael Rhodes",
"version": "2.0.3",
"version": "3.0.0",
"main": "index.js",
"repository": "git@github.com:michaelrhodes/scroll",
"description": "A function that animates an element’s scrollTop or scrollLeft position.",
"keyword": ["scrollTop", "scrollTo", "animate"],
"description": "animates the scroll top/left position of an element",
"keyword": ["scrollTop", "scrollLeft", "scrollTo", "animate"],
"license": "MIT",

@@ -13,5 +13,2 @@ "scripts": {

},
"dependencies": {
"rafl": "~1.2.1"
},
"devDependencies": {

@@ -18,0 +15,0 @@ "ease-component": "~1.0.0",

# scroll
animates the scroll top/left position of an element (in 340 bytes)
A function that animates an element’s scrollTop or scrollLeft position.
[![browser support](https://ci.testling.com/michaelrhodes/scroll.png)](https://ci.testling.com/michaelrhodes/scroll)
[![Browser support](https://ci.testling.com/michaelrhodes/scroll.png)](https://ci.testling.com/michaelrhodes/scroll)
note: you may need to polyfill [`requestAnimationFrame`](https://caniuse.com/#feat=requestanimationframe) in older browsers
## install
```sh
$ npm install scroll
npm install scroll
```
## use
```js

@@ -54,13 +53,5 @@ var scroll = require('scroll')

Note: The default easing is `inOutSine` from [component/ease](https://github.com/component/ease).
note: the default easing is `inOutSine` from [component/ease](https://github.com/component/ease).
| compression | size |
| :--------------- | ------: |
| scroll.js | 2.86 kB |
| scroll.min.js | 1.71 kB |
| scroll.min.js.gz | 764 B |
## obey
[MIT](http://opensource.org/licenses/MIT)
[MIT](https://github.com/michaelrhodes/scroll/blob/master/LICENSE)
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