Scroll to Top Button

Adds a scroll to top button at the bottom right of the page when scrolled to the bottom, and hides it at the top.

Από την 24/07/2024. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

Δημιουργός
DXRK1E
Βαθμολογίες
0 0 0
Έκδοση
1.5
Δημιουργήθηκε την
24/07/2024
Ενημερώθηκε την
24/07/2024
Μέγεθος
3 KB
Άδεια
MIT
Εφαρμόζεται σε
Όλοι οι ιστοχώροι

Scroll to Top Button Userscript

This userscript adds a convenient "Scroll to Top" button to web pages. The button appears at the bottom right of the page when scrolled to the bottom, and hides when at the top. It’s designed to enhance the browsing experience by providing quick navigation back to the top of the page.

Features

  1. Scroll to Top Button: A button that allows users to quickly scroll back to the top of the page.
  2. Visibility Control: The button appears only when the page is scrolled to the bottom and hides when at the top.
  3. Smooth Scrolling: The button uses smooth scrolling for a better user experience.

How It Works

  1. Button Creation:

    • The script creates a button element and styles it with CSS for a modern look.
    • The button is initially hidden using CSS properties opacity and visibility.
  2. Scroll Handling:

    • The handleScroll function checks the scroll position of the page and controls the visibility of the button.
    • The button becomes visible when the user scrolls to the bottom of the page and hides when scrolled up.
  3. Scroll to Top Functionality:

    • When the button is clicked, the page smoothly scrolls to the top using window.scrollTo.

Installation

To use this userscript, you need a userscript manager like Violentmonkey, Tampermonkey, or Greasemonkey. Follow these steps:

  1. Install a Userscript Manager:

  2. Adding the Script:

    • Simply click the button labeled "install the script" at the top.