diff options
author | WayJam So <imsuwj@gmail.com> | 2020-07-22 18:35:26 +0300 |
---|---|---|
committer | WayJam So <imsuwj@gmail.com> | 2020-07-22 18:35:26 +0300 |
commit | e18d66917332ea00f920cf17e798ecd1215c4140 (patch) | |
tree | fb6702c89ba7d9ea878256fb63cec5850667efc2 /assets | |
parent | 02f80e96db0e30b6d62702b1ab41ea257d89e871 (diff) |
format code
Diffstat (limited to 'assets')
-rw-r--r-- | assets/js/main.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/assets/js/main.js b/assets/js/main.js index 2b467a7..5300c36 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,11 +1,11 @@ -(function() { +(function () { const backToTopBtn = document.getElementById("back_to_top"); - window.onscroll = function() { + window.onscroll = function () { scrollFunction(backToTopBtn); }; - backToTopBtn.addEventListener("click", backToTop) + backToTopBtn.addEventListener("click", backToTop); })(); function scrollFunction(btn) { @@ -16,7 +16,7 @@ function scrollFunction(btn) { // When the user clicks on the button, scroll to the top of the document function backToTop(e) { - e.preventDefault() + e.preventDefault(); document.body.scrollTop = 0; // For Safari document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera } |