Opps Error 7.Next dot 2



Get Oops error while trying to run code. Please help to find the mistake:

var main = function(){

   var currentSlide = $('.active-slide');
   var nextSlide = currentSlide.next();
   var currentDot = $('.active-dot').removeClass('active-dot');
   var nextDot = currentDot.next().addClass('active-dot');
   if(nextSlide.length == 0) {
   nextSlide = $('.slide').first();
   nextDot = $('.dot').first();




Hi Mykola,

The problem with your code is that on lines 9 and 10, you're trying to be a bit too efficient. Remove the add/removeClass parts, then add


Right after where you do the same thing with the slides.
I hope this helps, please let me know if you have any questions!


Thank You for the answer. But this code was working well, exept returning Dot to first. Slider returns, but Dot no... I tryied your advices, and it still don't return.
But anyways, thank's for the help.


Now I tried your code once more, and it works :smile:
Thanl's :wink: