MediaWiki:Jump-button.js: Unterschied zwischen den Versionen

Aus LohnAs Wiki Test
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „// JavaScript source code var jumpPos = 0 // When the user scrolls down 20px from the top of the document, show the button window.onscroll = function() {scr…“)
 
(Die Seite wurde geleert.)
 
Zeile 1: Zeile 1:
// JavaScript source code
 
  
var jumpPos = 0
 
 
// When the user scrolls down 20px from the top of the document, show the button
 
window.onscroll = function() {scrollFunction()};
 
 
function scrollFunction() {
 
    if (document.body.scrollTop > 400 || document.documentElement.scrollTop > 400) {
 
        document.getElementById("jump-button").style.display = "block";
 
    } else {
 
        document.getElementById("jump-button").style.display = "none";
 
    }
 
}
 
 
// When the user clicks on the button, scroll to the top of the document
 
function topFunction() {
 
    document.body.scrollTop = 0;
 
    document.documentElement.scrollTop = 0;
 
}
 

Aktuelle Version vom 24. Juli 2018, 11:03 Uhr