Back to Top figuccio

Aggiungi pulsante per tornare all'inizio di ogni pagina.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name           Back to Top figuccio
// @author         figuccio
// @namespace      https://greasyfork.org/users/237458
// @description    Aggiungi pulsante per tornare all'inizio di ogni pagina.
// @version        3.1
// @match          *://*/*
// @grant          GM_addStyle
// @run-at         document-start
// @require        https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js
// @noframes
// @icon           https://www.google.com/s2/favicons?domain=greasyfork.org
// @license        MIT
// ==/UserScript==
 var $ = window.jQuery;
 $(document).ready(function() {
 $('body').append('<img class="toPageTop" title="Sali in alto" style="position:fixed;z-index:999999999999;bottom:40px;right:20px;cursor:pointer;border-radius:100%;width:70px;height:70px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABINJREFUeF7tmkFy2koQhv9W7PeWT3CBQFXE9vmdIPYJQk4QvIxYBJ8gzglMFihL804QcgKTE8TZIleZdwFQlrFd6lejWCmFCNQjzWBTwI6anp7ub3p6emZE2PIfbbn/2AHYRcCWE9gtgS0PgF0SXNsScM+uXezfPXee4AAxN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c5zSANTnMPTn7VjyWFHNudW91SMMf98/1H0TLLULLJry0BCqOl8qCeZDuBuZuDPUiRR158c3e52yM28kArIGrzUxCo+6EqClc0Ce8uTmhzC0lRfUPs/MPckpT+K8kSWwBESHQKfSJ+0iY9XpjsGn6UtSkbxOu9EI+C0/BFdtB3GbQW3dozQD3wg8iuGMynz6IoVgFUDWiB+fz+IQxA2+f2RNE6cK7R/hyFMwTWMHY52PHKTO5smtDUAVI2323QGwSXcTdO8iYBNmyaaNuwiwSXcTdO8iYBNmyaaNWx8B/wMj7yxftxxt6gAAAABJRU5ErkJggg==";/>');

        $(".toPageTop").hide(0);
        $(window).scroll(function(){
            if($(window).scrollTop() >= 500){
                $(".toPageTop").fadeIn(4000);
            }else{
                $(".toPageTop").stop(true,true).fadeOut(2000);
            }
        });
        $(".toPageTop").click(function(){
            $("html,body").animate({
                scrollTop:0
            },3000);
        });

    });