Top and Down Scroll Buttons

Smooth scroll buttons for top and bottom of page

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
lunagus
今日安裝
0
安裝總數
6
評價
0 0 0
版本
1.1
建立日期
2025-10-04
更新日期
2025-10-04
尺寸
8.2 KB
授權條款
MIT
腳本執行於
所有網站

Top and Down Buttons

A modern, optimized userscript that adds smooth scroll-to-top and scroll-to-bottom buttons to every webpage.

Installation

  1. Install a userscript manager:

  2. Click here to install the userscript or manually copy the code

Usage

Scroll Buttons

Two buttons will appear on the right side of your screen when viewing scrollable pages:

  • Up Button (bottom-right) - Scrolls to the top of the page
  • Down Button (top-right) - Scrolls to the bottom of the page

Interactions

  • Click - Smoothly scrolls to top/bottom with easing animation
  • Hover - Continuously scrolls while your mouse is over the button
  • Auto-hide - Buttons disappear when you're already at the top/bottom

Configuration

You can easily customize the script by modifying the CONFIG object:

const CONFIG = {
    speedClick: 500,        // Smooth scroll duration on click (ms)
    speedHover: 100,        // Continuous scroll speed on hover (ms)
    zIndex: 1001,           // Z-index for buttons
    scrollStep: 1,          // Pixels to scroll per interval on hover
    hideThreshold: 0        // Scroll position to show/hide buttons
};

Customization Examples

Faster scrolling on click:

speedClick: 300  // Change from 500 to 300

Slower continuous scrolling:

speedHover: 150  // Change from 100 to 150

Larger scroll steps:

scrollStep: 3    // Change from 1 to 3

Icons

Icons are from SVGRepo (CC0 License):

Support

If you encounter any issues or have suggestions, please open an issue on GitHub.