New wiki-page
m (Ikabodo moved page Widget:Test to Widget:SlideshowScript) |
mNo edit summary |
||
Line 3: | Line 3: | ||
</style> | </style> | ||
<script> | <script> |
Revision as of 10:03, 22 July 2017
<style> .mySlides {display:none;} </style>
<script> 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("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>