Приветствую! Подскажите, что не так:
<div>
<div id="tv1" class="tabcontent" style="display: block;">
<img src="./img/img1.jpg" alt="">
<img src="./img/img2.jpg" alt="">
</div>
<div id="tv2" class="tabcontent">
<img src="./img/img3.jpg" alt="">
<img src="./img/img4.jpg" alt="">
</div>
<div id="tv3" class="tabcontent">
<img src="./img/img5.jpg" alt="">
<img src="./img/img6.jpg" alt="">
</div>
</div>
<script>
var slideShow = function(container) {
this.images = [];
this.curImage = 0;
for (i = 0; i < container.childElementCount; i++) {
this.images.push(container.children[i]);
this.images[i].style.display = "none";
}
// Handle going to to the next slide
var nextSlide = function() {
for (var i = 0; i < this.images.length; i++) {
this.images[i].style.display = "none";
}
this.images[this.curImage].style.display = "block";
this.curImage++;
if (this.curImage >= this.images.length) {
this.curImage = 0;
}
window.setTimeout(nextSlide.bind(this), 5000);
};
nextSlide.call(this);
};
var slike = document.querySelectorAll("#tv1, #tv2, #tv3");
slideShow(slike);
</script>
Заранее спасибо