animated-scroll-to
Advanced tools
Comparing version 1.1.10 to 1.1.11
@@ -26,2 +26,3 @@ (function() { | ||
onComplete: undefined, | ||
passive: true | ||
}; | ||
@@ -102,12 +103,12 @@ | ||
}; | ||
window.addEventListener('keydown', handleUserEvent); | ||
window.addEventListener('mousedown', handleUserEvent); | ||
window.addEventListener('keydown', handleUserEvent, { passive: options.passive }); | ||
window.addEventListener('mousedown', handleUserEvent, { passive: options.passive }); | ||
} else { | ||
// Set handler to prevent user actions while scroll is active | ||
handleUserEvent = function(e) { e.preventDefault(); }; | ||
window.addEventListener('scroll', handleUserEvent); | ||
window.addEventListener('scroll', handleUserEvent, { passive: options.passive }); | ||
} | ||
window.addEventListener('wheel', handleUserEvent); | ||
window.addEventListener('touchstart', handleUserEvent); | ||
window.addEventListener('wheel', handleUserEvent, { passive: options.passive }); | ||
window.addEventListener('touchstart', handleUserEvent, { passive: options.passive }); | ||
@@ -114,0 +115,0 @@ var removeListeners = function () { |
@@ -22,2 +22,4 @@ // Type definitions for AnimateScrollTo 1.0.1 | ||
/** function that will be executed when the scroll animation is finished */ | ||
/** Sets passive event listeners **/ | ||
passive?: boolean; | ||
onComplete?(): void; | ||
@@ -24,0 +26,0 @@ } |
{ | ||
"name": "animated-scroll-to", | ||
"version": "1.1.10", | ||
"version": "1.1.11", | ||
"description": "Simple, plain JavaScript animated window scroll", | ||
@@ -5,0 +5,0 @@ "main": "animated-scroll-to.js", |
@@ -77,2 +77,5 @@ # animated-scroll-to | ||
// Set passive event Listeners to be true by default. Stops Chrome from complaining. | ||
passive: true | ||
// function that will be executed when the scroll animation is finished | ||
@@ -79,0 +82,0 @@ onComplete: function() {} |
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
20499
173
104