Difference between revisions of "MediaWiki:Common.js"

From Electrical Contacts
Jump to: navigation, search
(Created page with "Any JavaScript here will be loaded for all users on every page load.: $(function() { $(window).scroll(function() { if($(this).scrollTop() != 0) { $('#backtotop').fa...")
(No difference)

Revision as of 15:32, 27 February 2014

/* Any JavaScript here will be loaded for all users on every page load. */
$(function() {
	$(window).scroll(function() {
		if($(this).scrollTop() != 0) {
			$('#backtotop').fadeIn();	
		} else {
			$('#backtotop').fadeOut();
		}
	});
 
	$('#backtotop').click(function() {
		$('body,html').animate({scrollTop:0},800);
	});	
});