Skip to content

Commit 25e7ad2

Browse files
committed
Smooth scrolling
1 parent b1354bb commit 25e7ad2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

script/script.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
document.querySelector("._sticky-logo a").addEventListener("click", function(e) {
2+
if(window.scrollY > 0) {
3+
e.preventDefault();
4+
window.scrollTo({
5+
"behavior": "smooth",
6+
"left": 0,
7+
"top": 0,
8+
});
9+
this.blur();
10+
}
11+
});

0 commit comments

Comments
 (0)