I could really use some help


7. Next Dot 2

This code looks correct to me but can someone show me where I am making a mistake? This is the error it returns:

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.

var main = function() {
    $('.dropdown-toggle').click(function() {
    $('.arrow-next').click(function() {
        var currentSlide = $('.active-slide');
        var nextSlide = currentSlide.next();
        if(nextSlide.length == 0) {
            nextSlide = $('.slide').first();
            nextDot = $('.dot').first();
        var currentDot = $('.active-dot');
        var nextDot = $('.active-dot').next();



Declare the variables before the if statement above them.


And what are you doing with



Oh, those are for the slider animation.


That isn't helping. Any other ideas?


Please post a link to the exercise. Thanks.


Here is the link to the exercise.



Leon pointed out two lines that are incomplete. Go back through the exercise that first creates those lines and correct them. The lines can be written after the if statement.


Thanks a lot, that worked. It was a newbie error but I appreciate the help.


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