New wiki-page
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(7 intermediate revisions by the same user not shown)
Line 2: Line 2:
.mySlides {display:none;}
.mySlides {display:none;}
</style>
</style>
<div class="w3-container">
  <h2>Slideshow Indicators</h2>
  <p>An example of using buttons to indicate how many slides there are in the slideshow, and which slide the user is currently viewing.</p>
</div>
<div class="w3-center">
  <div class="w3-section">
    <button class="w3-button w3-light-grey" onclick="plusDivs(-1)">❮ Prev</button>
    <button class="w3-button w3-light-grey" onclick="plusDivs(1)">Next ❯</button>
  </div>
</div>


<script>
<script>
var slideIndex = 1;
var slideIndex = <!--{$firstslide}-->;
showDivs(slideIndex);
showDivs(slideIndex);



Latest revision as of 12:16, 22 July 2017

<style> .mySlides {display:none;} </style>

<script> var slideIndex = ; showDivs(slideIndex);

function plusDivs(n) {

 showDivs(slideIndex += n);

}

function currentDiv(n) {

 showDivs(slideIndex = n);

}

function showDivs(n) {

 var i;
 var x = document.getElementsByClassName("mySlides");
 var dots = document.getElementsByClassName("demo");
 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(" w3-red", "");
 }
 x[slideIndex-1].style.display = "block";  
 dots[slideIndex-1].className += " w3-red";

} </script>