7/12 Where's the bug?


I seem to be stuck attempting to move my dot back to the first dot. I have tried triple checking my code in the if statement as the "Oops" message suggests but it appears to be the same.

I even tried copying and pasting the code from the hint to no avail. It still says that the dot is not returning to the first.

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 = currentDot.next();





uhh stupid me! the vars have to be at the top with the other vars. DUH!


I got the same error, and the var's are at the top :smile:


same error. I don't know how to fix it


var currentDot = $('.active-dot');
var currentSlide = $('.active-slide');

Remove the class selector ( the dot before active) it gets the job done, I saw it in another help request


still not working. :frowning:


got it in the meantime. the problem was that I didn't remove the class active dot from currentDot and add it to the nextDot


it's very tricky with these dots. I encounter the same issues in the next exercises..


did you find the problem?

  1. You are using nextDot before you have even declared it. Those two lines ( var currentDot and var nextDot) need to be placed before the if statement (below the line var nextSlide) not after it.

  2. Use $() to remove and add classes, i.e $(currentDot).removeClass and $(nextDot).addClass


MAde the same mistake


make sure your if statement is directly after your variable declarations