您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Tap the top or bottom of the screen to scroll the page up or down, while ignoring taps on links and interactive elements.
// ==UserScript== // @name Tap to Scroll (Ignore Links) // @namespace http://tampermonkey.net/ // @version 2.3 // @description Tap the top or bottom of the screen to scroll the page up or down, while ignoring taps on links and interactive elements. // @author Your Name // @homepage https://gf.qytechs.cn/en/scripts/525817 // @match *://*/* // @grant none // ==/UserScript== (function() { 'use strict'; // Define the threshold for tap zones (e.g., top 20% and bottom 20% of the screen) const tapZoneThreshold = 0.2; // 20% of the screen height document.addEventListener('click', function(event) { // Check if the tap is on an interactive element (e.g., link, button, input) // li in freshrss const interactiveElements = ['A', 'BUTTON', 'INPUT', 'TEXTAREA', 'SELECT', 'LABEL', 'AUDIO', 'VIDEO', 'LI']; if (interactiveElements.includes(event.target.tagName)) { return; // Ignore taps on interactive elements } const screenHeight = window.innerHeight; const tapY = event.clientY; // Y-coordinate of the tap // Determine if the tap is in the top or bottom zone if (tapY < screenHeight * tapZoneThreshold) { // Tap in the top zone: scroll up window.scrollBy({ top: -window.innerHeight * 0.8, behavior: 'smooth' }); } else if (tapY > screenHeight * (1 - tapZoneThreshold)) { // Tap in the bottom zone: scroll down window.scrollBy({ top: window.innerHeight * 0.8, behavior: 'smooth' }); } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址