Здравствуйте.
Подскажите, пожалуйста, в чём проблема?
Uncaught TypeError: Cannot read property 'style' of undefined
// slider style
var slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("mySlides");
var dots = document.getElementsByClassName("dot");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
// if (true == slides) {
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
// }
// else{
// console.log("hellllllloo!")
// }
}
// slider style end
<div class="slideshow-container">
<div class="mySlides fade">
<img src="img/slider/304669-alexfas01.jpg">
<h2 class="text">
<span>Foto Club</span>
<span class="free">ԱՆՎՃԱՐ</span>
<span>ֆՈՏՈ</span>
<span>Նկարահանում</span>
<a href="../registration.php">Գրանցվել</a>
</h2>
</div>
</div>