Twitter scroll

Scroll images with mouse on twitter

As of 26/06/2022. See the latest version.

// ==UserScript==
// @name         Twitter scroll
// @namespace    Twitter
// @version      1.0
// @description  Scroll images with mouse on twitter
// @author       NightLancerX
// @match        https://twitter.com/*
// @match        https://mobile.twitter.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @license      MIT
// @grant        none
// @require      https://code.jquery.com/jquery-3.3.1.min.js
// @run-at       document-end
// @noframes
// ==/UserScript==

(function() {
	'use strict';

	let left, right;
	$('body').on('wheel', '[aria-roledescription="carousel"]', function(e){
		e.preventDefault();
		e.stopPropagation();

		if (e.originalEvent.deltaY < 0 && (left = document.querySelector('[data-testid="Carousel-NavLeft"]'))){
			left.click();
		}
		if (e.originalEvent.deltaY > 0 && (right = document.querySelector('[data-testid="Carousel-NavRight"]'))){
			right.click();
		}
	});
})();
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元