Number 7 Next Dot 2 - whats going on?


#1



https://www.codecademy.com/courses/web-beginner-en-seyrq/0/7?content_from=make-an-interactive-website%3Ajquery-effects#


It's not working at all and i can't find the error... please help!


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);
       currentSlide.removeClass('active-slide');
       nextSlide.fadeIn(600);
       nextSlide.addClass('active-slide');
       currentDot.removeClass('active-dot');
       nextDot.addClass('active-Dot');
       
    });
}

$(document).ready(main);

#2

u did not add this inside the if statement

nextDot = $('.dot').first();

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.