您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add top button on every page.
当前为
// ==UserScript== // @name Top // @namespace http://tampermonkey.net/ // @version 0.2 // @description Add top button on every page. // @author You // @match *://*/* // @grant none // ==/UserScript== (function() { 'use strict'; var parent = document.createElement('div'); var top = document.createElement('div'); top.append('Top') top.onclick = function() { window.scrollTo(0, 0) } top.className = 'go-top' top.style.position = 'fixed'; top.style.bottom = '20px'; top.style.right = '20px'; top.style.cursor = 'pointer'; top.style.zIndex = '999'; parent.append(top) document.body.append(parent); // Your code here... })();