What's wrong with my code on exercise 7?


#1

Cant find issue with my code:

var main = function () {
    $(".dropdown-toggle").click(function(){
        $(".dropdown-menu").toggle();
        });
        $('.arrow-next').click(function(){
        var currentSlide = $('.active-slide');
        var nextslide= currentSlide.next();
        if (nextslide.length==0){
            nextdot= $('.dot').first();
            nextslide= $('.slide').first();
            };
        currentSlide.fadeOut(600).removeClass('active-slide');
        nextslide.fadeIn(600).addClass('active-slide');
        var currentdot = $('.active-dot');
        var nextdot= currentdot.next();
        currentdot.removeClass('active-dot');
        nextdot.addClass('active-dot');
        });
    };
    $(document).ready(main)

#2

@pysolver82283 You need to define currentDot and nextDot at the top of $('.arrow-next').click(function() {});, rather than towards the bottom.


#3

Thanks a lot for that hint, you made my day!