Button Up

Кнопка вверх

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        Button Up
// @name:       ru
// @namespace   https://greasyfork.org/ru/users/9970-spacecatsch
// @icon        http://www.macwrench.de/images/thumb/d/db/Vorschlag.png/64px-Vorschlag.png
// @description Кнопка вверх
// @include     *
// @version     0.2
// @grant       none

// ==/UserScript==
(function($){
    $.fn.liScrollToTop = function(params){
        return this.each(function(){
            var scrollUp = $(this);
            scrollUp.hide();
            if ($(window).scrollTop() > 0) scrollUp.fadeIn("slow")
            $(window).scroll(function() {
                if ($(window).scrollTop() <= 0) scrollUp.fadeOut("slow")
                else scrollUp.fadeIn("slow")
            });
            scrollUp.click(function() {
                $("html, body").animate({scrollTop: 0}, "slow")
            })
        });
    };
})(jQuery);

/*Инициализация плагина*/
$(function(){
    $('.scrollUp').liScrollToTop();
});

//BTN
var parentElem = document.body.children[0];
var newBTN = document.createElement('div');
newBTN.id = "btn";
newBTN.innerHTML = '<div class="scrollUp" style="margin:0 auto;position:fixed;top:auto;bottom:10px;left:auto;right:50%;border-radius:1px;'+
    'background:transparent;z-index:9999;opacity:0.7;cursor:pointer;padding:1px 5px 3px;text-align:center;">'+
    '<div id="newBTN" style="width:40px;height:40px;text-align:center;background: url(http://www.macwrench.de/images/thumb/d/db/Vorschlag.png/64px-Vorschlag.png);background-size: cover;	background-size: 40px 40px;	background-repeat: no-repeat;"></div></div>';
parentElem.appendChild(newBTN);