Skip to content

Commit 095c1bc

Browse files
Fix menu active on scroll
1 parent 656c349 commit 095c1bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ function onScroll () {
5252
}
5353

5454
calculElements();
55-
setTimeout(() => {
56-
calculElements();
57-
}, 500)
55+
window.onload = () => {
56+
calculElements()
57+
};
5858
window.addEventListener('resize', function (e) {
5959
e.preventDefault();
6060
calculElements();

0 commit comments

Comments
 (0)