forked from vishanurag/Canvas-Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added "back to top" to all pages where it was missing
- Loading branch information
1 parent
c0981b5
commit 2249e7a
Showing
8 changed files
with
122 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const scrollToTopBtn = document.getElementById("BacktoTop"); | ||
window.onscroll = function () { | ||
scrollFunction(); | ||
}; | ||
|
||
function scrollFunction() { | ||
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) { | ||
scrollToTopBtn.style.visibility = 'visible'; | ||
scrollToTopBtn.style.opacity = '1'; | ||
} else { | ||
scrollToTopBtn.style.visibility = 'hidden'; | ||
scrollToTopBtn.style.opacity = '0'; | ||
} | ||
} | ||
|
||
scrollToTopBtn.addEventListener("click", function () { | ||
// Smooth scroll back to top | ||
window.scrollTo({ top: 0, behavior: 'smooth' }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters