Difference between revisions of "MediaWiki:Common.js"

m
m (Blanked the page)
(Tag: Blanking)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
 
  
 
var slideIndex = 1;
 
showDivs(slideIndex);
 
 
function plusDivs(n) {
 
  showDivs(slideIndex += n);
 
}
 
 
function currentDiv(n) {
 
  showDivs(slideIndex = n);
 
}
 
 
function showDivs(n) {
 
  var i;
 
  var x = document.getElementsByClassName("vslide");
 
  var dots = document.getElementsByClassName("vscap");
 
  if (n > x.length) {slideIndex = 1}   
 
  if (n < 1) {slideIndex = x.length}
 
  for (i = 0; i < x.length; i++) {
 
    x[i].style.display = "none";
 
  }
 
  for (i = 0; i < dots.length; i++) {
 
    dots[i].className = dots[i].className.replace(" btn-special", "");
 
  }
 
  x[slideIndex-1].style.display = "block"; 
 
  dots[slideIndex-1].className += " btn-special";
 
}
 

Revision as of 12:40, 26 July 2023