Exercise 9, getting told to fade out the current slide & remove the 'active-slide' class


#1

I keep getting [Oops, try again. Remember to fade out the current slide and remove the 'active-slide' class. ]

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

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

}

currentSlide.fadeOut(600).removeClass('active-slide');
prevSlide.fadeIn(600).addClass('active-slide');

});
}

};

what am I doing wrong????


9. Previous Slide 2
#2

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

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

currentSlide.fadeOut(duration).removeClass('active-slide');
prevSlide.fadeIn(duration).addClass('active-slide');
});
i've been doing this code the correct way


#3

Hi phillip,

Please post your complete code; the error isn't necessarily in one of the small bits you've posted.
Thanks!


#4

2 posts were split to a new topic: Can't pass #9, getting told to fade out the current slide and to remove the .active-slide class