MediaWiki:Vector.js: Unterschied zwischen den Versionen

Aus Wiki der Akademie der Bildenden Künste Nürnberg
Zur Navigation springen Zur Suche springen
Markierung: Manuelle Zurücksetzung
Zeile 35: Zeile 35:
//Inlist Incrementor
//Inlist Incrementor
incrementList();
incrementList();
function incrementList(){
function incrementList(){
console.log("Hallo");
console.log("Hallo");
     var inlists = document.querySelectorAll("#inlist");
     var inlists = document.querySelectorAll("#inlist");
     for (let i = 0; i < inlists.length; i ++){
     for (let i = 0; i < inlists.length; i ++){
         checkInlist(inlists[i]);
          
     }
     }
}
}


function checkInlist(inlist){
/*function checkInlist(inlist){
var ul = inlist.querySelector("ul");
var ul = inlist.querySelector("ul");
console.log(ul);
console.log(ul);
Zeile 50: Zeile 51:
     console.log(li.innerText);
     console.log(li.innerText);
});
});
}
}*/

Version vom 6. Januar 2022, 16:22 Uhr

/* Das folgende JavaScript wird für Benutzer der Vector-Benutzeroberfläche geladen. */

var scroll_x;
var scroll_y;

//Scroll
window.addEventListener("scroll", function(event) {
  scroll_y = this.scrollY;
  scroll_x = this.scrollX;

  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
    sc_t.style.display = "block";
  } else {
    sc_t.style.display = "none";
  }

});

//Search Field
document.querySelector("#searchInput").placeholder = "Suche…";
document.querySelector("#searchInput").focus();

//Add Scroll to top button
sc_t = document.createElement("div");
sc_t.id = "scroll-top-button";
document.querySelector("body").append(sc_t);
sc_t.addEventListener("click", topFunction);

function topFunction() {
  document.body.scrollTop = 0; // For Safari
  document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}


//Inlist Incrementor
incrementList();

function incrementList(){
console.log("Hallo");
    var inlists = document.querySelectorAll("#inlist");
    for (let i = 0; i < inlists.length; i ++){
        
    }
}

/*function checkInlist(inlist){
var ul = inlist.querySelector("ul");
console.log(ul);
const children = ul.childNodes;
Array.from(children).forEach(li => {
    console.log(li.innerText);
});
}*/