Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
scroll
Advanced tools
animates the scroll top/left position of an element
Weekly downloads
Readme
animates the scroll top/left position of an element (in 340 bytes)
note: you may need to polyfill requestAnimationFrame
in older browsers
npm install scroll
var scroll = require('scroll')
var page = require('scroll-doc')()
var ease = require('ease-component')
// Basic usage
scroll.left(page, 200)
// Register a callback
scroll.top(page, 200, function (err, scrollTop) {
console.log(err)
// { message: "Scroll cancelled" } or
// { message: "Element already at target scroll position" } or
// null
console.log(scrollTop)
// => The new scrollTop position of the element
// This is always returned, even when there’s an `err`.
})
// Specify a custom easing function
scroll.left(page, 200, { ease: ease.inBounce })
// Specify a duration in milliseconds (default: 350) and register a callback.
scroll.left(page, 200, { duration: 1000 }, function (err, scrollLeft) {
})
// Cancel a scroll animation
var options = { duration: 1000 }
var cancel = scroll.top(page, 200, options, function (err, scrollTop) {
console.log(err.message)
// => Scroll cancelled
page.removeEventListener('wheel', cancel)
})
page.addEventListener('wheel', cancel)
note: the default easing is inOutSine
from component/ease.
FAQs
animates the scroll top/left position of an element
The npm package scroll receives a total of 209,037 weekly downloads. As such, scroll popularity was classified as popular.
We found that scroll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.