Next Dot 1 - "Remember to remove '.active-dot' from the current dot"


#1

What's wrong with my code?

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();
            }
            
            currentSlide.fadeOut(600).removeClass('active-slide');
            nextSlide.fadeIn(600).addClass('active-slide');
            
            currentDot.removeClass('active-dot');
            nextDot.addClass('active-dot');
            
            
        });
        
        
        
        
    
}

#2

Hi Ilap617,

Is that your complete code? You're missing a call to your main function used to run it. Add this to the bottom of your code:

$(document).ready(main);

Edit:
You're also missing a closing single quote right here:

var currentSlide = $('.active-slide);

#3

I tried and it worked. Thank you Zystvan! You rock!


#4

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