dev

This is the talk page for discussing improvements to the BackToTopButton page.

Not working for me

See w:User:Fandyllic/global.js. I'm testing this on an old FF 3.6.27, so maybe that's the problem, but other JS works. -- Fandyllic (talk · contr) 12 Mar 2012 1:11 PM Pacific

Confirmed not working on FF.— subtank (7alk) 22:03, March 12, 2012 (UTC)
Yep I'm looking into it right now. Subtank, on FF 10, if you import the script in your global.js does it work then or is it still not loading? Because that works for me. --Noemon *talk* 22:34, March 12, 2012 (UTC)
Oh lookie, it works... maybe give the servers some time to load it up properly? It's always the case when it comes to making "something" to load in Wikia. :P
Check it again in three working days; if it doesn't load up (that is, without having the user to put it in their global.js), then there's something wrong.. — subtank (7alk) 00:31, March 13, 2012 (UTC)
Ok I think I got it. It seems that the problem was with the definition order of the functions. For some reason, when the script is local and not imported, Firefox's javascript engine did not like the fact that the functions were defined after the call to them was made. Chrome's engine seems to not care about that. On the tests I did it now works as it should when the script is local (as well as when it's imported), on both browsers.
Fandyllic, please, do tell me if it works on FF 3.6 now. If it does it definitely was an issue with the javascript engine. --Noemon *talk* 00:56, March 13, 2012 (UTC)
Loaded properly on FF (v10). :) — subtank (7alk) 01:21, March 13, 2012 (UTC)
Working now! Adding back my other JS. Hopefully it won't conflict. -- Fandyllic (talk · contr) 12 Mar 2012 6:17 PM Pacific

Fade-in/Fade-out

I actually don't like the fade in and fade out styles. Can I remove that feature please? -- Sam Wang (talk) 12:21, May 22, 2012 (UTC)

I added a "switch" between simple show/hide and fade in/out. Fading is set by default. :) --Noemon *talk* 18:36, May 26, 2012 (UTC)

Teaked version

I change the code an bit (lay-out sided). In this code the buttom is changed to an arrow image.

White arrow version:

SearchV2
//
 
//A script that adds a "Back To Top" button in the footer of the Oasis theme.
//I don't like scrolling back to top on long pages neither do you :)
//Created by Noemon from Dead Space Wiki
 
 
function hideFade () {
	// hide #backtotop first
	$( "#backtotop" ).hide ();
	// fade in #backtotop
	$( function () {
		$( window ).scroll( function () {
			if ( $( this ).scrollTop () > ButtonStart ) {
				switch(FadeSwitch) {
					case 0:				
						$( '#backtotop' ).show ();
						break;
					default:
						$( '#backtotop' ).fadeIn ();
						break;
				}
			} else {
				switch(FadeSwitch) {
					case 0:				
						$( '#backtotop' ).hide ();
						break;
					default:
						$( '#backtotop' ).fadeOut ();
						break;
				}					
			}
		});
	});
}

function goToTop (){
	// scroll body to 0px on click
	$( 'body,html' ).animate ({
		scrollTop: 0
	}, ScrollSpeed );
	return false;
}

function addBackToTop () {
	if( skin == 'oasis' ) {
		$('<li id="backtotop" style="position: absolute; right:-5px; top:-2px; border:none;"><span style=" padding: -5px; font-size: 97%; height: 17px; line-height: 16px;" type="button" value="Back To Top" onClick="goToTop();"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAALCAYAAACzkJeoAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s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eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFBJREFUeNrMjsENgAAIA083cBdHwFVY0llwlfoQTOMENiGklLRFEjancxdSD3JuiyQaBVzABuwAawvZ+2gxgNe2zC4ne0h9CpWk+EMhf457AKTUrQpOq3baAAAAAElFTkSuQmCC" alt="UP"></button></li>').appendTo('#WikiaFooter > .toolbar > .tools');	
		hideFade ();
	}	
}

var ButtonStart = 800;
var ScrollSpeed = 2000;
var FadeSwitch = 1;

if( !window.BackToTop  ) {
	$( document ).ready( addBackToTop );
}

var BackToTop = true; // prevent duplication
	
if( typeof Start == "number" ) {
	ButtonStart = Start;
}

if( typeof Speed == "number" ) {
	ScrollSpeed = Speed;
}	

if( typeof ToggleFading == "number" ) {
	FadeSwitch = ToggleFading;
}
//


Black arrow code:

SearchV2
iVBORw0KGgoAAAANSUhEUgAAAAcAAAALCAYAAACzkJeoAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHH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66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFFJREFUeNrEzkERwDAIRNGHhHqphGqJyWihVugl6VAFPTADu/wFVWUX5mduxkBhbC2WISISN46qOqFTufrE9cYuYbTFuRM7NTv9+0PtfuJ6BgCNkIAEL3NaPQAAAABJRU5ErkJggg==

No Longer Working

With the recent site wide change to the layout, the BackToTopButton is no longer appearing in the toolbar.

--Whistle9 (Talk) 10:44, October 3, 2012 (UTC)

I've given it a kick, hopefully it's ground back into action. Lunarity 11:02, October 3, 2012 (UTC)
Seems to be working again. I think the appearance of the button needs to be altered though; it is now partway off the toolbar.
--Whistle9 (Talk) 09:15, October 4, 2012 (UTC)
I didn't write this, I'm only familiar with how the toolbar works and what changes Wikia made so I knew why it was broken. I'll look in to why it isn't placing the button properly when I don't have anything else that needs doing if no-one else does first; you may want to contact the author directly on their talk page instead. Lunarity 10:16, October 4, 2012 (UTC)

Home button

This feature is definitely and undeniably useful, but won't the "Home" button on the keyboard replace this, especially for more keyboard-orientated users? I haven't tried this yet, so I offer my sincere apologies if I'm wrong. — SW8573 (Message Wall) 12:25, October 4, 2012 (UTC)

Yes, the "home" button should functionally serve exactly the same purpose as this script. However... the percentage of people who actually know that is very low :P20px_Rin_Tohsaka_Avatar.png Mathmagician ƒ(♫) 01:38 UTC, Friday, 5 October 2012

Text

Any chance we can get the text to be "Back to top" rather than "Back To Top"? Sorry, the title case just annoyed me. Or possibly "Scroll back to top".--Technobliterator 00:37, January 2, 2016 (UTC)

You can change it in code, text is the last "Back to top" in line 47, looks like the only way is copy the code to your js and change it.--Mark orz (talk) 10:04, April 26, 2016 (UTC)

No Longer Scrolls

Yesterday I noticed that this script no longer functions properly (conveniently lining up with an update of the script's code). The button now appears no matter how far to the top of the article you are. Also, clicking on the button does nothing. At this point it's just a useless button. DEmersonJMFM 14:09, May 14, 2016 (UTC)

Thanks for the fixes. A minor issue left - there's a piece of border to the right that wasn't there before. DEmersonJMFM 15:24, May 14, 2016 (UTC)
Where is this at? I'll look into it. Rappy 15:38, May 14, 2016 (UTC)
To the right of the button. DEmersonJMFM 16:47, May 14, 2016 (UTC)
I meant which wiki. I'm not seeing a border. Rappy 16:50, May 14, 2016 (UTC)
Example

Example

It's not wiki-specific as I see it on every wiki. It's also not caused by user CSS. I'm using Chrome if that's any help. DEmersonJMFM 19:33, May 14, 2016 (UTC)
Odd. I'm on Chrome too and I am not seeing that. Rappy 21:47, May 14, 2016 (UTC)
I did see it while piggyback you though. Odd that I didn't see it. This should have fixed it. Rappy 21:52, May 14, 2016 (UTC)

Confused On Where To Place Code Mentioned In Modernization Section

I've placed the line dev:BackToTopButton/code.js but in the rest of the Guide, it doesn't specifically state where to place each type of code for that style to be accepted. So I'm currently confused and obviously at an impasse until the Guide is updated.

Currently, the line is omitted at http://warrenwoodhouse.wikia.com/wiki/MediaWiki:ImportJS

Warren Woodhouse | Blog | Talk | Videos | Quote: "I can accept failure, everyone fails at something. What I can't accept is not trying." - Quote By: Michael Jordan 16:32, August 18, 2018 (UTC)

Hello, if you would like to give the BackToTopButton a "modern" look, add the this code to the top of your wiki's Common.js page: window.BackToTopModern = true;. While you're at it, you may want to remove importScriptPage('MediaWiki:Translator/Translator.js', 'dev'); and add dev:Translator/Translator.js to the ImportJS page. Once you've edited Common.js, click the "submit for review" button to the right so FANDOM Staff can review it and make it go live. Hope that helps! Patrik 16:39, August 18, 2018 (UTC)

use the right css property instead of left

Since the BackToTopButton should ideally appear on the right hand side of the screen, why does it use left instead of right? I imagine what it would take is removing

    function modernReposition() {
        this.css('left', (
            mw.util.$content.offset().left +
            // left: 5%
            mw.util.$content.width() * 95 / 100
        ) + 'px');
    }


What it currently looks like

What it currently looks like

What it looks like with right: 20px;

What it looks like with right: 20px;

from MediaWiki:BackToTopButton/code.js and adding something like right: 20px; to MediaWiki:BackToTopButton.css but I don't really do anything with JS so I don't know for sure. ~ Forge the Hybrid (wall) 01:24, March 12, 2019 (UTC)

Hey, that's like that because of https://dev.fandom.com/wiki/MediaWiki:BackToTopButton/code.js?diff=93859&oldid=85039, which was done due to the w:Help:Customization policy. --Sharkie 03:29, March 12, 2019 (UTC)

Customize modern back to top button

Hello,
Does anyone who knows coding knows how to replace the modern back to top button with an image? Like I want to replace the btt button of this wiki with this image. (Img source:[1]). I saw Bendy Wiki managed to customized theirs so I think it might be possible to do the same.

{{SUBST:User:Aphrodite Belleza/Sig}} 14:54, June 6, 2019 (UTC)

Here (change the size of the button to your needs):
#BackToTopBtn div {
    border-radius: initial;
    background: url(https://www.shonenjump.com/j/sp_neverland/present_2019/img/btn_top.png) no-repeat !important;
    background-size: contain !important;
    width: 100px;
    height: 100px;
}
#BackToTopBtn svg {
    visibility: hidden;
}

-- Khang (talk) 00:41, June 7, 2019 (UTC)

@Khang: Thank you so much for your help! 😁 Aphrodite (talk) June 7, 2019 (UTC)

Solution

If you guys need the solution to this, you can see it working on my Wiki. Apparently there is a mistake in the code and I managed to correct it.

Add the line shown below to the page MediaWiki:ImportJS. Then after it’s added, save the page and purge it, this makes the code work.

dev:BackToTopButton/code.js

Then add the code below to the page MediaWiki:Common.js, save the page and then purge the page. You need to purge both pages for the code to take effect.

window.BackToTopModern = true;

This solves the problem. I think the documentation page for this plugin doesn’t seem to make sense so I sort of worked it out. It works fine on my Wiki and for those wanting to have a look, my Wiki is available at www.warrenwoodhouse.fandom.com

I make a lot of cool maps using Google Maps My Maps which feature real life locations from video games, movies, tv shows, etc.

Also I have lots of other cool pages too.

Enjoy! :D

Warren Woodhouse | Blog | Talk | Videos | Quote: "I can accept failure, everyone fails at something. What I can't accept is not trying." - Quote By: Michael Jordan 16:51, June 10, 2019 (UTC)

Compatibility with UCP

This script doesn't work at UCP right now. I asked Fandom Support and they answered me that script needs to be recoded to remove the need for $.throttle. Just letting know anybody interesting in that about this problem.

Bumbarek (talk)

Somebody fixed it already. Now its working on UCP. Bumbarek (talk) 16:57, November 19, 2020 (UTC)

Customizations not working on UCP

Need some help, please.

I've been using this script site-wide on the wiki I manage with the following options:

window.BackToTopSpeed = 1; (instantly moves back to the top, without scrolling up)
window.BackToTopStart = 200; (the button appears soon after starting to scroll down a page)

These codes are placed on my wiki's MediaWiki:Common.js page and they were working fine until a few days ago. However, after UCP went live on our site, the button now already appears at the top of all pages (that is, not after having scrolled down a bit). In addition, when the button is clicked, it scrolls back to the top instead of instantly jumping to it (example).

Is the page where these options should be added different on UCP than the one I currently have them? If so, could you please inform me where they should be added now?

On a related note, the code that appears on the article: dev:BackToTopButton/code.js has never worked for me. Our wiki's Councilor was kind enough to change it to dev:ModernBackToTopButton/code.js, which does work. If this is an error, you should probably correct it on the article, as well as add a link to the page where the options should be added (e.g.: MediaWiki:Common.js).

Thank you very much in advance. --LaVey (talk) 07:11, January 24, 2021 (UTC)

The code in your Common.js is throwing errors. You can replace your countdown script with Countdown, wall greeting script with WallGreeting, only leave the BackToTopButton configuration there and submit it for review. -- Cube-shaped garbage can 14:47, January 24, 2021 (UTC)
I see. Those two codes were already there before I became staff of that wiki and now that I've seen what they're for –and since they don't seem to be very useful after all– I might as well remove them altogether. I have the idea some of the previous staff members often used that site for experimentation, so that might explain why they're there (our Wikia.css is also bloated with walls of old code which I have no idea what they're for). I'll submit the page for review without those codes and report back. Thank you for the suggestion.
UPDATE: Well, I did just that, but instead of outright submitting it for review, I opted to enter "Test Mode" first, although so far I haven't seen any improvement. Is there a possibility that the codes for customizing these options were modified at some point?
--LaVey (talk) 15:04, January 24, 2021 (UTC)
Reporting back. I removed all other code from my wiki's MediaWiki:Common.js and just left the two options I mentioned above for "BackToTopButton", submitted it and it's already live, and the issue still persists: the button already appears from the beginning of all pages and when clicked it scrolls up instead of instantly jumping to the top.
I must also mention that this behavior replicates on all the wikis I administer.
--LaVey (talk) 07:46, January 25, 2021 (UTC)
This should be working after the latest revision has been approved. -- Cube-shaped garbage can 12:44, January 25, 2021 (UTC)
Just checked, the revision is already live and the script is working correctly now. Thank you very much for the fix!
--LaVey (talk) 12:50, January 25, 2021 (UTC)
Lol I had about half on hour sitting on it, and once I figured it out I discovered that it was fixed 10 minutes ago... Nam 12:52, January 25, 2021 (UTC)

Seems to not be working

I was checking some of the imports on the Wings of Fire Fanon Tribes Wiki while I was adding ReferencePopups to the wiki and noticed this script in that wiki's ImportJS. Looking at the way this script is supposed to function, it didn't seem to ever function on that wiki, even with my personal CSS and JS being toggled off. I tested it also on my test wiki with no other imports and still while toggling my personal CSS and JS off, and it still didn't work. Unless my chromebook's age is related, this script seems to not be working in its current form. I've removed it from the Wings of Fire Fanon Tribes Wiki for the time being - BronzeRattle (🐍) 19:14, 9 September 2025 (UTC)

It still runs fine in my side. Have you checked scrolling down the page for a while? {{SUBST:User:Marisa1980/Sig}} 19:45, 9 September 2025 (UTC)
Did some further testing, and yeah it does show now. I misread the documentation page and didn't realize it's supposed to be in the toolbar 🙃. Readded it - BronzeRattle (🐍) 04:34, 11 September 2025 (UTC)

Is the arrow version not working?

Hi, I'm trying to test this on my wiki. I've tried adding window.BackToTopModern = true; and window.BackToTopArrow = true; to my personal JS, expecting one of them to display the arrow instead of the toolbar button, but neither worked. How exactly am I supposed to do this?

Tsskyx (talk) 12:31, 28 February 2026 (UTC)

To be exact, I'm only trying to test this for now, I don't yet have JS enabled on my wiki globally.

Tsskyx (talk) 16:09, 1 March 2026 (UTC)

Update, the issue was on my end. I assumed things I shouldn't have assumed and completely misunderstood how personal importing worked. All good now.

Tsskyx (talk) 19:13, 3 March 2026 (UTC)

Custom customization of modern back to top button

Hello! I've implemented back to top button and it works wonderfully, but i want to change its colours for some of the pages of my wiki. So in common.css I have default button (at the bottom of the page) https://gaben.fandom.com/ru/wiki/MediaWiki:Common.css But in custom css pages (also in the very bottom) i have different background colours set for the button: https://gaben.fandom.com/ru/wiki/MediaWiki:Birds.css https://gaben.fandom.com/ru/wiki/MediaWiki:Mister.css

Basically, my snippets look like this:

.page-NAMEOFTHEPAGE #BackToTopBtn div {
	background-color: #153148;
opacity: 0.7;
transition: .5s;
}

But it doesn't seem to work. What did I do wrong? Thank you for help! Nadenkee (talk) 11:57, 1 April 2026 (UTC)