MediaWiki:Common.css — различия между версиями

Материал из doc.abonent.plus
Перейти к: навигация, поиск
Строка 3: Строка 3:
 
#ca-viewsource { display:none; !important; }
 
#ca-viewsource { display:none; !important; }
  
 +
// ==============================
 +
// BackToTopButton
 +
// ==============================
 +
 +
//A script that adds a "Back To Top" option in the footer of the Oasis theme.
 +
//People 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 ) {
 +
$( '#backtotop' ).fadeIn ();
 +
} else {
 +
$( '#backtotop' ).fadeOut ();
 +
}
 +
});
 +
});
 +
}
 +
 
function goToTop (){
 
function goToTop (){
 
// scroll body to 0px on click
 
// scroll body to 0px on click
Строка 13: Строка 37:
 
function addBackToTop () {
 
function addBackToTop () {
 
if( skin == 'oasis' ) {
 
if( skin == 'oasis' ) {
$('<li id="backtotop" style="position: absolute; right:20px; top:0px; border:none;"><button type="button" value="Наверх" onClick="goToTop();">Наверх</button></li>').appendTo('#WikiaBarWrapper .toolbar > .tools');
+
$('<li id="backtotop" style="position: absolute; right:20px; top:0px; border:none;"><button type="button" value="Back To Top" onClick="goToTop();">Back To Top</button></li>').appendTo('#WikiaBarWrapper .toolbar > .tools');
 
hideFade ();
 
hideFade ();
 
}
 
}
Строка 26: Строка 50:
 
});
 
});
 
}
 
}
var BackToTop = true;
+
var BackToTop = true; // prevent duplication

Версия 15:09, 14 июля 2016

<sup>Надстрочный текст</sup>/* Размещённый здесь CSS будет применяться ко всем темам оформления */
#ca-talk  { display: none !important; }
#ca-viewsource { display:none; !important; }

// ==============================
// BackToTopButton
// ==============================
 
//A script that adds a "Back To Top" option in the footer of the Oasis theme.
//People 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 ) {
				$( '#backtotop' ).fadeIn ();
			} else {
				$( '#backtotop' ).fadeOut ();
			}
		});
	});
}
 
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:20px; top:0px; border:none;"><button type="button" value="Back To Top" onClick="goToTop();">Back To Top</button></li>').appendTo('#WikiaBarWrapper .toolbar > .tools');	
		hideFade ();
	}	
}
 
var ButtonStart = 800;
var ScrollSpeed = 600;
 
if( !window.BackToTop  ) {
	$( document ).ready( function () { 
		addBackToTop (); 
	});
}
var BackToTop = true; // prevent duplication