MediaWiki:Gadget-ToTopButton.js

// To Top Button by User:BrandonXLF on English Wikipedia // Licensed under CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/) // Documentation: https://en.wikipedia.org/wiki/User:BrandonXLF/ToTopButton // Source: https://en.wikipedia.org/wiki/User:BrandonXLF/ToTopButton.js

$(function {	var circle = $(' ')		.appendTo('body')		.addClass('topButtonCircle')		.on('click', function { $('html, body').animate({scrollTop: 0}, 'slow'); })		.append(' ');

$(window).scroll(function {		if ($(window).scrollTop > 100) {			circle.fadeIn;		} else {			circle.fadeOut;		}	}); });