Translation - Μετάφραση

Resources, Technical Assistance and Technology News => Translator resources => Tips on Using Computers => Topic started by: spiros on 04 Oct, 2021, 18:48:15

Title: Back to top links in Mediawiki/Wikipedia
Post by: spiros on 04 Oct, 2021, 18:48:15
Back to top links in Mediawiki/Wikipedia

Back to top and search suggestions on Project:Support desk (
Wikipedia:Back to top - Wikipedia (

Or, if you have Edit section disabled you can use mw-headline to trigger the event (add in Common.js):

Code: [Select]
( function () {
var elems = document.getElementsByClassName('mw-headline'); // *** NOTE: ClassName may need to be 'mw-editsection' instead
for (i = 0; i < elems.length; i++) {
var span = document.createElement('span');
var link = document.createElement('a');
link.href = '#top';
link.appendChild(document.createTextNode('back to top'));
span.appendChild(document.createTextNode('] '));
elems[i].insertBefore(span, elems[i].firstChild);

Since I also added a style, you need to add the following in Common.css to have the text in a small size and right-aligned.

Code: [Select]
span.ttop {
    float: right;
    font-size: small;