Previous Slide2, can't find error


#1



This is a request for help on the Ninth exorcise on Interactive Website: Flipboard.

https://www.codecademy.com/en/courses/web-beginner-en-seyrq/0/9?content_from=make-an-interactive-website%3Ajquery-effects#


Whenever I run the code an erroneous messages appears saying : "Oops, try again. Remember to fade in the previous slide and add the 'active-slide' class." To my knowledge, I have correctly faded the previous slide out. This is very confusing, and even more-so, frustrating. Please help me, even if it is to progress beyond this by simply giving me the code, which I'd rather not happen.


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();
        };
        
        currentSlide.fadeOut(600).removeClass('active-slide');
        nextSlide.fadeIn(600).addClass('active-slide');
        currentDot.removeClass('active-dot');
        nextDot.addClass('active-dot');
    });
    
    $('.arrow-prev').click(function(){
        var currentSlide = $('.active-slide');
        var prevSlide = currentSlide.prev();
        
        if(prevSlide.length == 0){
         prevSide = $('.slide').last();   
        }
        
        currentSlide.fadeOut(600).removeClass('active-slide');
        prevSlide.fadeIn(600).addClass('active-slide');
    });
};
$(document).ready(main);


#2

Please Ignore This For I Have Found My Error. (missing l in prevSlide)


#3

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.