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

scrollfeatures

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrollfeatures - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "scrollfeatures",
"version": "1.0.0",
"version": "1.0.1",
"description": "Performant Custom Scroll Features and Events",

@@ -5,0 +5,0 @@ "main": "dist/scrollfeatures.js",

@@ -9,7 +9,6 @@ # ScrollFeatures

```
scrollY
scrollX
y
x
speedY
speedX
angle // TODO
directionY

@@ -39,27 +38,35 @@ directionX

var ScrollFeatures = require('scrollfeatures');
var scrollEvents = new ScrollFeatures(); // takes window as scroll target
var scrollFeatures = new ScrollFeatures(); // takes window as scroll target
// or
new ScrollFeatures(yourElement)
new ScrollFeatures(document.querySelector('yourElement'))
scrollEvents.on('scroll:down', function(event) {
scrollFeatures.on('scroll:down', function(event) {
console.log('========== scroll:down =============');
});
scrollEvents.on('scroll:up', function(event) {
scrollFeatures.on('scroll:up', function(event) {
console.log('========== scroll:up =============');
});
scrollEvents.on('scroll:start', function(event) {
console.log('scroll:start y:' + scrollEvents.y + ' direction: ' + scrollEvents.directionY+' ('+ ScrollFeatures.directionToString(scrollEvents.directionY)+')')
scrollFeatures.on('scroll:max', function(event) {
console.log('========== scroll:max =============');
});
scrollEvents.on('scroll:progress', function(event) {
console.log('scroll:progress y:' + scrollEvents.y + ' direction: ' + scrollEvents.directionY+' ('+ ScrollFeatures.directionToString(scrollEvents.directionY)+')')
scrollFeatures.on('scroll:min', function(event) {
console.log('========== scroll:min =============');
});
scrollEvents.on('scroll:stop', function(event) {
console.log('scroll:stop y:' + scrollEvents.y + ' direction: ' + scrollEvents.directionY+' ('+ ScrollFeatures.directionToString(scrollEvents.directionY)+')')
scrollFeatures.on('scroll:start', function(event) {
console.log('scroll:start y:' + scrollFeatures.y + ' direction: ' + scrollFeatures.directionY+' ('+ ScrollFeatures.directionToString(scrollFeatures.directionY)+')')
});
scrollFeatures.on('scroll:progress', function(event) {
console.log('scroll:progress y:' + scrollFeatures.y + ' direction: ' + scrollFeatures.directionY+' ('+ ScrollFeatures.directionToString(scrollFeatures.directionY)+')')
});
scrollFeatures.on('scroll:stop', function(event) {
console.log('scroll:stop y:' + scrollFeatures.y + ' direction: ' + scrollFeatures.directionY+' ('+ ScrollFeatures.directionToString(scrollFeatures.directionY)+')')
});
```
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