MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus e-vendo Wiki
Wechseln zu: Navigation, Suche
 
(30 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 2: Zeile 2:
  
  
/* ==== back to top-button ==== */
+
/* ==== accordion ==== */
document.getElementById("btt").addEventListener("mouseenter",function(){ this.style.opacity="1.0", this.style.transition="0.5s" });
 
document.getElementById("btt").addEventListener("mouseleave",function(){ this.style.opacity="0.7", this.style.transition="0.5s" });
 
  
 +
$('.accordion').click(function(){
 +
$(this).toggleClass('active').next('.panel').slideToggle(300);
 +
});
  
/* ==== accordion ==== */
+
$('.accordion2').click(function(){
var acc = document.getElementsByClassName("accordion");
+
$(this).toggleClass('active2').next('.panel2').slideToggle(300);
var i;
+
});
  
for (i = 0; i < acc.length; i++) {
+
$('.accordion3').click(function(){
    acc[i].addEventListener("click", function() {
+
$(this).parents().children('.active3').not($(this)).removeClass('active3').next('.panel3').slideUp(300);
        this.classList.toggle("active");
+
$(this).toggleClass('active3').next('.panel3').slideToggle(300);
 +
});
  
        if (panel.style.display === "block") {
 
            panel.style.display = "none";
 
        } else {
 
            panel.style.display = "block";
 
        }
 
    });
 
}
 
  
 +
/* ==== back to top-button ==== */
  
/* ===== Scroll to Top ==== */
+
document.getElementById("btt").addEventListener("mouseenter",function(){ this.style.opacity="1.0", this.style.transition="0.3s" });
$(window).scroll(function() {
+
document.getElementById("btt").addEventListener("mouseleave",function(){ this.style.opacity="0.8", this.style.transition="0.3s" });
    if ($(this).scrollTop() >= 50) {        // If page is scrolled more than 50px
 
        $('#return-to-top').fadeIn(200);    // Fade in the arrow
 
    } else {
 
        $('#return-to-top').fadeOut(200);  // Else fade out the arrow
 
    }
 
});
 
$('#return-to-top').click(function() {     // When arrow is clicked
 
    $('body,html').animate({
 
        scrollTop : 0                       // Scroll to top of body
 
    }, 500);
 
});
 

Aktuelle Version vom 9. August 2018, 11:33 Uhr

/* Das folgende JavaScript wird für alle Benutzer geladen. */


/* ==== accordion ==== */

$('.accordion').click(function(){
 $(this).toggleClass('active').next('.panel').slideToggle(300);
});

$('.accordion2').click(function(){
 $(this).toggleClass('active2').next('.panel2').slideToggle(300);
});

$('.accordion3').click(function(){
 $(this).parents().children('.active3').not($(this)).removeClass('active3').next('.panel3').slideUp(300);
 $(this).toggleClass('active3').next('.panel3').slideToggle(300);
});


/* ==== back to top-button ==== */

document.getElementById("btt").addEventListener("mouseenter",function(){ this.style.opacity="1.0", this.style.transition="0.3s" });
document.getElementById("btt").addEventListener("mouseleave",function(){ this.style.opacity="0.8", this.style.transition="0.3s" });