MediaWiki:Vector.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Wendl (Diskussion | Beiträge) |
Wendl (Diskussion | Beiträge) |
||
Zeile 2: | Zeile 2: | ||
//Listeners | //Listeners | ||
document.addEventListener("scroll", scrollEvent); | //document.addEventListener("scroll", scrollEvent); | ||
window.addEventListener("scroll", scrollEvent); | |||
//Search Field | //Search Field | ||
Zeile 13: | Zeile 13: | ||
function scrollEvent( | function scrollEvent(event){ | ||
console.log( | var scroll_y = this.scrollY; | ||
var scroll_x = this.scrollX; | |||
console.log(scroll_x, scroll_y);) | |||
} | } | ||
/* | |||
window.addEventListener("scroll", function(event) { | window.addEventListener("scroll", function(event) { | ||
var scroll_y = this.scrollY; | var scroll_y = this.scrollY; | ||
var scroll_x = this.scrollX; | var scroll_x = this.scrollX; | ||
console.log(scroll_x, scroll_y); | console.log(scroll_x, scroll_y); | ||
}); | });*/ |
Version vom 4. Januar 2022, 23:16 Uhr
/* Das folgende JavaScript wird für Benutzer der Vector-Benutzeroberfläche geladen. */ //Listeners //document.addEventListener("scroll", scrollEvent); window.addEventListener("scroll", scrollEvent); //Search Field document.querySelector("#searchInput").placeholder = "Suche…" document.querySelector("#searchInput").focus(); //Personal //document.querySelector("#p-personal").focus(); function scrollEvent(event){ var scroll_y = this.scrollY; var scroll_x = this.scrollX; console.log(scroll_x, scroll_y);) } /* window.addEventListener("scroll", function(event) { var scroll_y = this.scrollY; var scroll_x = this.scrollX; console.log(scroll_x, scroll_y); });*/