Line 27: | Line 27: | ||
<script> | <script> | ||
− | var | + | var myIndex = 0; |
− | + | carousel(); | |
− | function | + | function carousel() { |
− | + | var i; | |
− | + | var x = document.getElementsByClassName("mySlides"); | |
− | + | for (i = 0; i < x.length; i++) { | |
− | + | x[i].style.display = "none"; | |
− | + | } | |
− | + | myIndex++; | |
− | + | if (myIndex > x.length) {myIndex = 1} | |
− | + | x[myIndex-1].style.display = "block"; | |
− | + | setTimeout(carousel, 2000); // Change image every 2 seconds | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
</script> | </script> |
Revision as of 17:00, 6 July 2016
❮
❯