I can't finish 6.Next Dot 1


#1

Here is my code and I get error msg saying 'Remember to remove '.active-dot'. funny thing is I could pass 6.2 with the same code i wrote. Help me :smiley:

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)


#2

@mochimojji,
You are not closing the dropdown-toggle =click= Eventhandler with });
leading to
the arrow-next =click= Eventhandler being =inside= of the dropdown-toggle =click= Eventhandler

The structure of the =main= Function should look like

var main = function() {
     //Begin of =main= FUNCTION-BODY
        $('.dropdown-toggle').click(function(){
              $('.dropdown-menu').toggle();
        });

        $('.arrow-next').click( function() {
             //code which gets executed when =click=ed
        });
        $('.arrow-prev').click( function() {
             //code which gets executed when =click=ed
        });
     //End of =main= FUNCTION-BODY
};
$(document).ready( main );

#3

Thank you so much ! I was able to finish it with adding });