Comparing version 2.0.3 to 3.0.0
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) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6203
0
5
104
57
- Removedrafl@~1.2.1
- Removeddom-walk@0.1.2(transitive)
- Removedglobal@4.3.2(transitive)
- Removedmin-document@2.19.0(transitive)
- Removedprocess@0.5.2(transitive)
- Removedrafl@1.2.2(transitive)