This forum is now read-only. Please use our new forums! Go to forums
I don't see the error here?
I did exactly what they asked me to do and it says: 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.
here is the code:
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()
currentDot.removeClass('active-dot')
nextDot.addClass('active-dot')
if(nextSlide.length == 0) {
nextSlide = $('.slide').first();
nextDot = $('.dot').first();
}
currentSlide.fadeOut(600).removeClass('active-slide');
nextSlide.fadeIn(600).addClass('active-slide')
});
} $(document).ready(main)
Answer 53e51cc19c4e9d76bd000226
4 votes
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.
Answer 547c75f180ff3355e300c2ac
1 comments
Zachary Mercer-Gerrior over 9 years
I agree!
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
1 comments
Also at the end of $(document).ready(main) you should add a semi-colon ( ; )