Next dot 1 - Oops, try again. Make sure you have defined all the variables!


#1

var main = function() {

$('.dropdown-toggle').click(function() {
$('.dropdown-menu').toggle();
});

$('.arrow-next').click(function() {
var currentSlide = $('.active-slide');
var nextSlide = currenSlide.next();

var currentDot = $('.active-dot');
var nextDot = currentDot.next();

if(nextSlide.length === 0) {
nextSlide = $('.slide').first();
nextDot = $('.dot').first();

}

currentSlide.fadeOut(600).removeClass('active-slide');
nextSlide.fadeIn(600).addClass('active-slide');

currentDot.removeClass('active-dot');
nextDot.addClass('active-dot');

});

};

$(document).ready(main);

what did I do wrong? please help


#2

what's the error message?

Uncaught ReferenceError: currenSlide is not defined

it means somewhere in your code you wrote currenSlide instead of currentSlide

find and correct it :slight_smile:


#3

you are god, thank you so much


#4

This topic is solved.