7. Next dot 2


#1



I'm having trouble with 7. Next Dot 2, I read that 'currenDot.removeClass...' should be below the 'if statement' and I did that but still does not work. Can anyone tell what am I missing?


This is the error message:

When on the last slide, it looks like next arrow isn't wrapping back to the first dot. Look back at the instructions and check the code inside the if statement.


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();
            nextDot = $('.dot').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

@dnlcrze

Have a close look at

'active -slide'


#3

Oh, you're right. Thank you.


#4

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