This forum is now read-only. Please use our new forums! Go to forums
code same as hint but still not working
Not able to flip through the images using the arrow next icon.
var main = function(){ $(‘.dropdown-toggle’).click(function(){ $(‘.dropdown-menu’).toggle();
});
$(‘.arrow-next’).click(function(){ var currentSlide=$(‘.active-slide’); var nextSlide= currentSlide.next();
if(nextSlide.length === 0) { nextSlide = $(‘.slide’).first(); }
currentSlide.fadeOut(600).removeClass(‘active-slide’); nextSlide.fadeIn(600).addClass(‘active-class’);
});
};
$(document).ready(main);
Checked and double checked with the code mentioned in the hint. But it showing the same error every time that is “Look back at the instructions and check the code inside the if statement.”
Cannot make out what the error is here. Can somebody help?
Answer 5593af5476b8fed7760001d1
Answer 5593f00a9113cb5d9f0004fa
Yours is this Mine isn’t working either, but I noticed this about yours which may help you.
currentSlide.fadeOut(600).removeClass(‘active-slide’); nextSlide.fadeIn(600).addClass(‘active-class’);
This is the code inside the hint 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
3 comments
—— .addClass(‘active-slide)
Thanks Courtney. Yeah noticed. And guess what, it worked. You try it too. It might work.
didn’t work says:oops try again:Remember to fade out the current slide and remove the ‘active-slide’ class. code:- var main = function(){ $(‘.dropdown-toggle’).click(function(){ $(‘.dropdown-menu’).toggle();
});
$(‘.arrow-next’).click(function(){ var currentSlide=$(‘.active-slide’); var nextSlide= currentSlide.next();
if(nextSlide.length === 0) { nextSlide = $(‘.slide’).first(); }
currentSlide.fadeOut(600).removeClass(‘active-slide’); nextSlide.fadeIn(600).addClass(‘active-class’);
});
};
$(document).ready(main);