scrollfeatures
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"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)+')') | ||
}); | ||
``` |
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
57103
71