Next Dot 1


#1

Remember to remove '.active-dot' from the current dot. This is the error I keep getting and I honestly have been working on this and reading other posts on this topic. I'm fairly new to coding can anyone tell me what is wrong with my following code

$('.arrow-next').click(function) {
var currentSlide = $('.active-slide');
var nextSlide = currentSlide.next();

var currentDot = $('.active-dot')
var nextDot = currentDot = currentDot.next();

if(nextSlide.length == 0) {
nextSlide = $'.slide').first();
}

currentSlide.fadeOut(600).removeClass('active-slide');
nextSlide.fadeIn(600).addClass('active-slide');

currentDot.removeClass('active-dot');
nextDot.addClass('active-dot');
});
}

$(document).ready(main);


#2

You've assigned the variable nextDot twice here, and I'm not sure if this is valid.

I'm guessing you want something more like

var nextDot = currentDot.next();

where you're taking the currentDot value, finding the next one, and assigning that value to nextDot.