您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Tool to let you scroll to the top of the page
当前为
// ==UserScript== // @name Scroll Up // @version 1.01 // @description Tool to let you scroll to the top of the page // @author A Meaty Alt // @exclude https://fairview.deadfrontier.com/onlinezombiemmo/index.php?page=21 // @include /fairview.deadfrontier.com/ // @exclude https://fairview.deadfrontier.com/onlinezombiemmo/ExternalLoginReg.php // @exclude http://chat.deadfrontier.com // @grant none // @namespace // ==/UserScript== (function() { 'use strict'; var scroller = document.createElement("img"); scroller.src = "https://puu.sh/xluRH/c8dd354a59.png"; scroller.id = "scroller"; scroller.style.opacity = 0.3; scroller.style.position = "fixed"; scroller.style.zIndex = 99; scroller.style.cursor = "pointer"; scroller.style.bottom = "30px"; scroller.style.right = "20px"; scroller.height = 100; scroller.width = 100; function defineOnClickEvent(){ $(scroller).click(function() { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); } function defineOnScrollEvent(){ $(document).scroll(function() { if($(window).scrollTop() === 0) { $("#scroller").css("opacity", 0.3); } else $("#scroller").css("opacity", 1); }); } defineOnScrollEvent(); defineOnClickEvent(); document.getElementsByTagName("body")[0].appendChild(scroller); })();