Scroll To Top

When user scrolled down of page then it will make easy to get back to top of the page.

Stan na 13-08-2017. 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        Scroll To Top
// @namespace   Back top top of the document
// @description When user scrolled down of page then it will make easy to get back to top of the page.
// @include     *
// @version     1
// @require		https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
// @grant       GM_addStyle
//
// ==/UserScript==
GM_addStyle ("[data-scroll]{height: 50px;width: 200px;font-size: 18px;line-height: 50px;text-transform: uppercase;text-align: center;background-color: rgba(255, 99, 71, 0.4);color: white;cursor: pointer;position: fixed;bottom: 10px;right: 10px;dispaly: none;z-index:999999;}[data-scroll]:hover {background-color: #ff6347;}");
$(function()
 {
  scroll_btn=$("<div />");
  scroll_btn.attr("data-scroll",'0');
  scroll_btn.html("▲Back to Top▲");
  scroll_btn.hide();
  $("body").append(scroll_btn);
  $(window).scroll(function()
  {
    var window_height=$(window).height();
    var scroll_height=$(document).scrollTop();
    if(scroll_height>0)
      {
         scroll_btn.show(100);
      }
    else
      scroll_btn.hide(100);
  });
  scroll_btn.click(function(e)
  {
    e.preventDefault();
    $(window).scrollTop(0);
  });
});