pageup/pagedown button

try to take over the world!

Stan na 27-10-2020. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         pageup/pagedown button
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       zjsxwc
// @match        http://*
// @match        https://*/*
// @match        https://*.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    window.pageup = function pageup() {
        scrollBy(0, -window.screen.availHeight*0.72);
    }

    window.pagedown = function pagedown() {
        scrollBy(0,  window.screen.availHeight*0.72);
    }

    //工具条
    var tool_bar = $('<div id="tool-bar" style="top:45%;right:0px;position:fixed;float:right;font-size:0.5em"></div>');
    tool_bar.append("<p style='float:right'><div id='up' onclick='pageup()' style=\"background-color: rgba(243,0,0,0.3);margin-bottom: 30px;height: 25px;\">UP</div></p>");
    tool_bar.append("<p style='float:right'><div id='down' onclick='pagedown()' style=\"background-color: rgba(243,0,0,0.3);margin-bottom: 30px;height: 25px;\">DOWN</div></p>");
    $('body').append(tool_bar);

    document.body.style.backgroundColor="white";

})();