This forum is now read-only. Please use our new forums! Go to forums
7/12 Problem-I'm Stuck
I followed the instructions in this lesson and it’s not letting me go through. The message I’m getting is, “Oops, try again. When on the last slide, it looks like next arrow isn’t wrapping back to the first dot. Look back at the instructions and check the code inside the if statement.” and this is the code I have for now:
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.length == 0) {
nextSlide = $('.slide').first();
nextDot = $('.dot').first();
}
currentDot.removeClass('active-dot');
nextDot.addClass('active-dot');
});
}
$(document).ready(main);
Is it me or is there a glitch, or error, in the lesson itself?
Answer 53db09c6548c355989000ac5
-3 votes
You’re missing these two line:
currentSlide.fadeOut(600).removeClass(‘active-slide’); nextSlide.fadeIn(600).addClass(‘active-slide’);
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
2 comments
Where you have // currentDot.removeClass(‘active-dot’) and nextDot.addClass(‘active-dot’), there should be a period( . ) in front of active-dot.
That way it reads: (‘.active-dot’). Try that, I think it will solve your problem. :)
I was actually stuck in the same place. from http://www.codecademy.com/forum_questions/53e3c8388c1ccc2a71000149 Can someone explain why there should be a period? Because I didn’t see a period in front of //active-slide.
This can’t be correct. Although it allows you to “pass” the test, it breaks the code (dot doesn’t work at all) This one is most frustrating - I even reset the code - went back a step and copied exactly the answer from the hint and it still doesn’t accept it at all. However, I am a NOOB so :)
var main = function() { $(‘.dropdown-toggle’).click(function() { $(‘.dropdown-menu’).toggle(); });
};
$(document).ready(main);