您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
scroll infinitely up and down
- // ==UserScript==
- // @name unlimited scroll
- // @namespace http://tampermonkey.net/
- // @version 6.9
- // @description scroll infinitely up and down
- // @author therandomdude
- // @match *://*/*
- // @grant none
- // @license MIT
- // ==/UserScript==
- (function() {
- 'use strict';
- const contentDiv = document.createElement('div');
- contentDiv.style.width = '10000px';
- contentDiv.style.height = '10000px';
- document.body.appendChild(contentDiv);
- window.addEventListener('scroll', function() {
- const scrollX = window.scrollX;
- const scrollY = window.scrollY;
- if (scrollX + window.innerWidth >= contentDiv.offsetWidth) {
- contentDiv.style.width = (contentDiv.offsetWidth + window.innerWidth) + 'px';
- }
- if (scrollY + window.innerHeight >= contentDiv.offsetHeight) {
- contentDiv.style.height = (contentDiv.offsetHeight + window.innerHeight) + 'px';
- }
- });
- })();