Next dot 1_can't make it work


#1

Excercise: https://www.codecademy.com/en/courses/web-beginner-en-seyrq/0/6?content_from=make-an-interactive-website%3Ajquery-effects#2

I'm having a problem with the code of excercise 6 (next dot 1) and checked all the remarks also other people in this forum gave.

Here's the code I used:

var main = function () {
$('.dropdown-toggle').click(function(){
$('.dropdown-menu').toggle();
});
$('.arrow-next').click(function(){
var currentSlide = $('.active-slide');
var nextSlide = currentSlide.next();

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

if(nextSlide.lenght == 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);

Uff :pensive:


#2

Hi! I've had this problem too and just found out what's missing. I compared our codes and I think there's just something missing there... I think you didn't close the main function. try putting }; before the $(document).ready(main); line. I hope this helps.


#3

I've tried that, but it doesnìt work...
It pops out this message "Remember to add '.active-dot' to the next dot."
The thing is, I added the active-dot to the next dot class :confused:


#4

uhuh, just saw something else in your code.. in your if statement, length spelling is incorrect.


#5

couldn't figure out my problem so I just started over it worked