Exercise 7, Next Dot 2, can't find the problem


Same issue but can't find what's wrong in the code, here is my code :slightly_smiling:

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').removeClass('active-dot');
    var nextDot = currentDot.next().addClass('active-dot');




Hi Petit,

You need to create the currentDot and nextDot variables right by the currentSlide and nextSlide variables at the top of that function, then do stuff with them below rather than what you're currently doing, which is doing stuff with them, creating them, and doing more stuff with them.
Make sense? :slightly_smiling:


Thanks, problem solved :slightly_smiling: