11. Remember to remove '.active-dot' from the current dot


#1

Why is this error occurring?? I followed their instructions to the letter. Please help!! This is so frustrating. Thanks in advance!

var main = function(){
    $('.dropdown-toggle').click(function() {
    $('.dropdown-menu').toggle();
  });
  
    $('.arrow-next').click(function() {
        var currentDot = $('.active-dot');   
        var nextDot = currentDot.next();
        
     
        var currentSlide = $('.active-slide');
        var nextSlide = currentSlide.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');
    });
    
    $('.arrow-prev').click(function()   {
        var currentSlide = $('.active-slide');
        var prevSlide = currentSlide.prev();
        
        var currentDot = $('.active-dot');
        var prevDot = currentDot.prev();
        
        if (prevSlide.length == 0){
            prevSlide = $('.slide').last();
            prevDot = $('.dot').last();
        }
        
        currentSlide.fadeOut(600).removeClass('active-slide');
        prevSlide.fadeIn(600).addClass('active-slide');
        
    });
}

$(document).ready(main);

#2

I believe the error may be referring to your $('.arrow-prev').click() function, which isn't removing the active-dot class from currentDot or adding it to prevDot.

If that's not the case, I need the link to the exact exercise so I know which one you're referring to.