Hi everyone,
I created a simple Slideshow using html5 and Javascript like that:
<ul id="slides">
<li class="slide showing"><img src="img/Bild1.jpg" width="420" height="290"></li>
<li class="slide"><img src="img/Bild2.jpg" width="420" height="290"></li>
<li class="slide"><img src="img/Bild3.jpg" width="420" height="290"></li>
</ul>
<button class="controls" id="previous">Previous</button>
<button class="controls" id="next">Next</button>
<script>
var slides = document.querySelectorAll('#slides .slide');
var currentSlide = 0;
var slideInterval = setInterval(nextSlide,4000);
function nextSlide() {
slides[currentSlide].className = 'slide';
currentSlide = (currentSlide+1)%slides.length;
slides[currentSlide].className = 'slide showing';
}
var next = document.getElementById('next');
var previous = document.getElementById('previous');
next.onclick = function() {
pauseSlideshow();
nextSlide();
};
previous.onclick = function() {
pauseSlideshow();
previousSlide();
};
</script>
my problem is that the Slideshow is working very well, but the buttons do not. They are visible but not able to change the pictures.
Anyone who can help?
Thanks in advance