您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds the ability to scroll down the story page to the clicked-on paragraph.
当前为
// ==UserScript== // @name FIMFiction - Simplified Read Flow // @namespace Selbi // @include http*://*fimfiction.net/story/*/* // @include http*://*fimfiction.net/chapter/* // @version 2.2 // @grant none // @description Adds the ability to scroll down the story page to the clicked-on paragraph. // ==/UserScript== // Set some constants. const MARGIN_TOP = 20; const SCROLL_SPEED = 500; const FADE = "all 200ms ease"; // Get all paragraphs of this chapter page. var paragraphs = $("#chapter_container p"); // Create an event listener for clicking on any of these paragraphs. // Scroll the entire page down to a little over the clicked paragraph. $(paragraphs).click(function() { $('html,body').animate({ scrollTop: ($(this).offset().top) - MARGIN_TOP }, SCROLL_SPEED); }); // Add some cosmetic effects for hovering over a paragraph. $(paragraphs).hover( // Fade-in function(){ $(this).css({ cursor : "pointer", //filter : "invert(100%)", "-webkit-transition" : FADE, "-moz-transition" : FADE, "-o-transition" : FADE, "transition" : FADE, "opacity" : "0.5" }); } , // Fade-out function(){ $(this).css({ //filter : "invert(000%)", "opacity" : "1.0" }); } );