#9 Previous Slide 2


indent preformatted text by 4 spaces

var main = function() {
$('.dropdown-toggle').click(function() {


$('.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();

    if (nextDot.length == 0) {
            nextDot = $('.dot').first();



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

    if (prevSlide.length == 0) {
        prevslide = $('.slide').last();





My code is above. I have been looking at it for at least an hour now and cannot figure out where I am going wrong?!? I have read all the topics that relate to this same section but still cannot see what needs changing.
The error msg reads: Oops, try again. Remember to fade in the previous slide and add the 'active-slide' class.
I have tried changing the }; after the if (prevSlide.Length ... statement to a } as this is how it appears in the hint. I still get the same error message though. :frowning: Any help would be much appreciated.


Just noticed that I have a small 's' for the prevslide instead of a capital 'S'.
I have changed this and tried again but still get the same error msg.


Don't know how or why but this now works. Nothing else was changed with the code. Happy days :smiley: