#9 - Why does it keep telling me to fade out the current slide?


#1

Can you help me too? I have exactly his code, but already have the closing bracket on $('.arrow-next') function as you advised. I still get the same error message.
Entire code below:

var main = function(){
    $('.dropdown-toggle').click(function() {
    $('.dropdown-menu').toggle();
  });
  
    $('.arrow-next').click(function() {
        var currentDot = $('.active-dot');   
        var nextDot = currentDot.next();
        
     
        var currentSlide = $('.active-slide');
        var nextSlide = currentSlide.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){
            prevSlide = $('.slide').last();
        }
        
        currentSlide.fadeOut(600).removeClass('active-slide');
        prevSlide.fadeIn(600).addClass('active-slide');
        
    )};
};

$(document).ready(main);

9. Previous slide 2 -- "Remember to fade out the current slide..."
#2

Hi Devoncorrellmoore,

You need to close stuff in the order you open it, so it should be }); instead :wink:


#3

A post was split to a new topic: "remember to fade out current slide" error - what's wrong here?