Skip to content

Commit 9b33caa

Browse files
committed
fix: remove throttle
1 parent b1825eb commit 9b33caa

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

093-creative portfolio/script.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function init() {
7272
current = pageNumber;
7373
isAnimating = false;
7474
}
75-
document.addEventListener("wheel", throttle(scrollChange, 1500));
75+
document.addEventListener("wheel", scrollChange);
7676

7777
function scrollChange(e) {
7878
if (isAnimating) return;
@@ -119,18 +119,4 @@ function init() {
119119
});
120120
}
121121

122-
// avoid multiple firing
123-
function throttle(func, limit) {
124-
let inThrottle;
125-
return function () {
126-
const args = arguments;
127-
const context = this;
128-
if (!inThrottle) {
129-
func.apply(context, args);
130-
inThrottle = true;
131-
setTimeout(() => (inThrottle = false), limit);
132-
}
133-
};
134-
}
135-
136122
init();

0 commit comments

Comments
 (0)