summaryrefslogtreecommitdiff
path: root/live/static/scripts/return_top.js
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2024-03-07 21:55:16 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2024-03-07 21:55:16 -0600
commitbd86f4fc950cdc5bb4cb346f48c14a6e356dc4fb (patch)
treec1cebd6a0b48c38e2100d8e4fe9745fd7f585bd5 /live/static/scripts/return_top.js
parentca9c5626495c00f6d6cffd4ae517a66db15b0832 (diff)
stop tracking live/main
Diffstat (limited to 'live/static/scripts/return_top.js')
-rw-r--r--live/static/scripts/return_top.js21
1 files changed, 0 insertions, 21 deletions
diff --git a/live/static/scripts/return_top.js b/live/static/scripts/return_top.js
deleted file mode 100644
index 77c468f..0000000
--- a/live/static/scripts/return_top.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// Taken from https://www.w3schools.com/howto/howto_js_scroll_to_top.asp
-// and tweaked as needed
-document.addEventListener("DOMContentLoaded", function(event) {
- let returnTopButton = document.getElementById("returnTopButton");
- let scrollTopAppearPX = window.screen.availHeight;
-
- window.onscroll = function() {scrolling(returnTopButton, scrollTopAppearPX)};
-})
-
-function scrolling(returnButton, onScrollAppear) {
- if (document.body.scrollTop > onScrollAppear || document.documentElement.scrollTop > onScrollAppear) {
- returnButton.style.display = "inline-block";
- } else {
- returnButton.style.display = "none";
- }
-}
-
-function returnTop() {
- document.body.scrollTop = 0; // For Safari
- document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
-}