F95Zone Gallery - Mouse Wheel Navigation

Navigate Gallery images with the mouse wheel

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         F95Zone Gallery - Mouse Wheel Navigation
// @namespace    https://gameil.com/
// @version      2026-09-09
// @description  Navigate Gallery images with the mouse wheel
// @author       Gameil
// @match        https://f95zone.to/threads/*/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=f95zone.to
// @grant        none
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function () {
  "use strict";
  let lastWheelTime = 0;
  const WHEEL_DELAY = 200;

  document.addEventListener(
    "wheel",
    function (event) {
      // Only respond when lightGallery is actually open
      const gallery = document.querySelector(".lg");

      if (!gallery) {
        return;
      }

      const now = Date.now();
      if (now - lastWheelTime < WHEEL_DELAY) {
        event.preventDefault();
        return;
      }

      lastWheelTime = now;
      const direction = Math.sign(event.deltaY);

      if (direction === 0) {
        return;
      }

      const button =
        direction > 0
          ? gallery.querySelector(".lg-next")
          : gallery.querySelector(".lg-prev");

      if (!button) {
        return;
      }

      event.preventDefault();
      event.stopPropagation();

      button.click();
    },
    {
      passive: false,
      capture: true,
    },
  );
})();