Scroll To Top

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

اعتبارا من 13-08-2017. شاهد أحدث إصدار.

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

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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);
  });
});