Complete course but problem with actual website


#1

Completed the course and passed but the website is not functional. The dots delete every time I hit next and and the dot doesn't move when I hit previous. The slides work fine. It passed me, but I'm just curious as to what happened because each thing seemed to work in the individual lessons.

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

$(document).ready(main);

#2

Hi Mfossel23,

I'm pretty sure that

currentDot.fadeOut(600).removeClass('active-dot');

should be just

currentDot.removeClass('active-dot');

It's the fadeOut() that removes your dot :)