Next Dot 2


#1



I do not see the error in this code. Please help me out here!


 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();
        }        
       
        currentDot.removeClass('active-dot');
        nextDot.addClass('active-dot');
        
        currentSlide.fadeOut(600).removeClass('acitve-slide');
        nextSlide.fadeIn(600).addClass('active-slide');      
    });
}
$(document).ready(main);


#2

This is the error I am getting with your code:

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.

I replaced this line and solved the problem:

        currentSlide.fadeOut(600).removeClass('active-slide');

Notice the spelling?


#3

Thank you! Man oh man I stared at this code for like 1hr and I'm just
retyping and did the rest of that exercise with no problem. Then I'd come
back to it. Thank you again, I'll check harder next time for misspelled
words!


#4

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