7.Next dot 2: Next dot not wrapping back to first dot


7.Next dot 2


I'm trying to get the dot to wrap back to the first dot. I've looked at the hint, and i'm pretty sure that my code is identical to it. It comes up with an error message that says:

Oops, try again. 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.

My code:

var main = 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();



HI this part of the code should be at then end (or just after the if statement ) inside the $('.arrow-next').click(function(){ ... )};


because your are using it in the if statement so if you remove it the if statement won't find it.


Ohh! Now I get it! Thanks so much! :slight_smile:


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