Why does it tell me to remove the active-dot class from the current dot? (Next Dot 1)


#1

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();   
    }

     
    currentSlide.fadeOut(600).removeClass('active-slide');
    nextSlide.fadeIn(600).addClass('active-slide');
        
    currentDot.removeClass('active-dot');
    nextDot.addClass('active-dot');
   
        
    });

});

};

$(document).ready(main);

Although I am getting the same issue and I cannot see what is wrong..?


Next Dot 1
#2

I've already answer it ...you shouldn't closed your $('.dropdown-toggle').click(function() after the $('.arrow-next').click(function() but before.