您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Keep your hand free from scroll button.
当前为
- // ==UserScript==
- // @name lazyScroller (beta)
- // @version 0.24
- // @description Keep your hand free from scroll button.
- // @namespace idmresettrial
- // @author idmresettrial
- // @run-at document-end
- // @grant none
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
- // Website list
- // @match http://vozforums.com/*
- // End list
- // ==/UserScript==
- red = "#f84848"; green = "#7abf16"; blue = "#3e68b3";
- color = blue;
- transparent = 0.5;
- distance = $(window).height()-50;
- duration = 500;
- wait = 500;
- pause = 1000;
- var repeat;
- direct = "lazySleep";
- lazyScroller = '<div id="lazyScroller"><div class="lazyButton" id="lazyUp">↑</div><div class="lazyButton" id="lazyDown">↓</div></div>';
- $("body").append(lazyScroller);
- $("#lazyScroller").css({"cursor":"default", "position":"fixed", "top":"-100px", "left":"-100px", "margin":"10px", "z-index":"999"});
- $(".lazyButton").css({"margin":"5px", "width":"20px", "height":"20px", "font-family":"calibri", "font-size":"12px", "line-height":"20px", "text-align":"center", "background":color, "color":"#FFFFFF"});
- $(".lazyButton").fadeTo(0, transparent);
- $(document).on("mousemove",function(e) {
- if (Math.abs(parseInt($("#lazyScroller").css("left"))-e.clientX)>50 || Math.abs(parseInt($("#lazyScroller").css("top"))-e.clientY)>100) {
- $("#lazyScroller").css({"left":e.clientX, "top":e.clientY, "display":"none"});
- } else {
- if ($('body').scrollTop() === 0) {
- $("#lazyUp").html("→");
- } else if ($('body').scrollTop() === ($(document).height()-$(window).height())) {
- $("#lazyDown").html("←");
- } else {
- $("#lazyUp").html("↑");
- $("#lazyDown").html("↓");
- }
- $("#lazyScroller").fadeIn();
- }
- });
- $("#lazyScroller .lazyButton").mouseover(function() {
- direct = $(this).attr("id");
- $(this).fadeTo(500, 1);
- setTimeout(function() {go();},wait);
- });
- $("#lazyScroller .lazyButton").mouseout(function() {
- direct = "lazySleep";
- $(this).fadeTo(500, transparent);
- clearTimeout(repeat);
- });
- $("#lazyScroller #lazyUp").click(function() {
- if ($('body').scrollTop() === 0) {
- direct = "lazyNext";
- } else {
- direct = "lazyTop";
- }
- go();
- });
- $("#lazyScroller #lazyDown").click(function() {
- if ($('body').scrollTop() === ($(document).height()-$(window).height())) {
- direct = "lazyBack";
- } else {
- direct = "lazyBottom";
- }
- go();
- });
- function go()
- {
- if (direct === "lazyUp") {
- $("body").animate({scrollTop: ($("body").scrollTop()-distance)}, duration);
- repeat = setTimeout(function() {go();},duration+pause);
- } else if (direct === "lazyDown") {
- $("body").animate({scrollTop: ($("body").scrollTop()+distance)}, duration);
- repeat = setTimeout(function() {go();},duration+pause);
- } else if (direct === "lazyTop") {
- $("body").animate({scrollTop: 0},duration);
- } else if (direct === "lazyBottom") {
- $("body").animate({scrollTop: ($(document).height()-$(window).height())},duration);
- } else if (direct === "lazyNext") {
- history.go(+1);
- } else if (direct === "lazyBack") {
- history.go(-1);
- } else {
- clearTimeout(repeat);
- }
- }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址