MediaWiki:Vector.js: Unterschied zwischen den Versionen

Aus Wiki der Akademie der Bildenden Künste Nürnberg
Zur Navigation springen Zur Suche springen
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(e){
function scrollEvent(event){
console.log(e.target)
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);
});*/