11/12 Is it wrong?


#1

I almost done it! But is says: Oops, try again. Remember to remove '.active-dot' from the current dot.
I can't find where is my wrong... Could anyone help me?

var main = function() {
$('.dropdown-toggle').click(function(){
$('.dropdown-menu').toggle();

});

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

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

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

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

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

});

$('.arrow-prev').click(function() {
var currentSlide = $('.active-slide');
var prevSlide = currentSlide.prev();

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

var currentDot = $('.active-dot');
var prevDot = currentDot.prev();

if(prevSlide.length === 0) {
prevSlide = $('.slide').last();
prevDot = $('.dot').last();

}

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

});

}

$(document).ready(main);


#2

https://www.codecademy.com/pt-BR/forum_questions/54d1aa8f9113cb0d3d00137b


#3

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

this should be:
currentSlide.fadeOut(600).removeClass('active-slide');
prevSlide.fadeIn(600).addClass('active-slide');

remove the dot before active-slide