您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Aggiunge un pulsante per tornare all'inizio delle pagine.
// ==UserScript== // @name To Top Buttonfiguccio // @author figuccio // @namespace https://gf.qytechs.cn/users/237458 // @description Aggiunge un pulsante per tornare all'inizio delle pagine. // @version 0.4 // @match *://*/* // @noframes // @grant GM_addStyle // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net // @license MIT // ==/UserScript== (function() { 'use strict'; var toTopButton = document.createElement('div'); toTopButton.innerHTML = '<button id="toTopButton" type="button" title="Torna su">🡹</button>'; toTopButton.setAttribute('id', 'toTopContainer'); document.body.appendChild(toTopButton); // Attiva il pulsante appena aggiunto. document.getElementById("toTopButton").addEventListener("click", function() { window.scrollTo(0, 0); }); // Stile del pulsante. GM_addStyle(` #toTopButton { position: fixed; bottom: 2px; right: 170px; text-align: left; font-size: 11pt; font-weight: bold; cursor: pointer; color: red !important; background-color: yellow; border: 2px solid black; border-radius: 12px; padding: 6px 15px; z-index: 99999; text-decoration: none; } `); // Mostra o nasconde il pulsante in base alla posizione dello scroll. function toggleButtonVisibility() { var button = document.getElementById("toTopContainer"); if (document.body.scrollTop > 500 || document.documentElement.scrollTop > 500) { button.style.display = 'block'; } else { button.style.display = 'none'; } } // Aggiorna la visibilità del pulsante all'avvio e ad ogni scroll. window.addEventListener('load', toggleButtonVisibility); window.addEventListener('scroll', toggleButtonVisibility); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址