MediaWiki:Common.js: Διαφορά μεταξύ των αναθεωρήσεων

Από Trace Project
Χωρίς σύνοψη επεξεργασίας
Χωρίς σύνοψη επεξεργασίας
Γραμμή 1: Γραμμή 1:
$(function reveal() {
$(function reveal() {
   var reveals = document.querySelectorAll(".reveal");
   var body = document.body;
 
  body.className = 'red';
   for (var i = 0; i < reveals.length; i++) {
   var slider = new Swiper ('.swiper-container', {
     var windowHeight = window.innerHeight-600;
     pagination: '.swiper-pagination',
     var elementTop = reveals[i].getBoundingClientRect().top;
    direction: 'vertical',
     var elementVisible = 150;
    slidesPerView: 1,
 
     paginationClickable: true,
     if (elementTop < windowHeight - elementVisible) {
     spaceBetween: 30,
      reveals[i].classList.add("active");
    mousewheelControl: true,
    } else {
     onSlideChangeStart: function (swiper) {
      reveals[i].classList.remove("active");
        var currentSlide = swiper.slides[ swiper.activeIndex ];
     }
        body.className = currentSlide.getAttribute( 'data-bg' );
  }
     },
});
}());
}());


window.addEventListener("scroll", reveal);
window.addEventListener("scroll", reveal);

Αναθεώρηση της 20:20, 15 Φεβρουαρίου 2023

$(function reveal() {
  var body = document.body;
  body.className = 'red';
  var slider = new Swiper ('.swiper-container', {
    pagination: '.swiper-pagination',
    direction: 'vertical',
    slidesPerView: 1,
    paginationClickable: true,
    spaceBetween: 30,
    mousewheelControl: true,
    onSlideChangeStart: function (swiper) {
        var currentSlide = swiper.slides[ swiper.activeIndex ];
        body.className = currentSlide.getAttribute( 'data-bg' );
    },
});
}());

window.addEventListener("scroll", reveal);