With dot or without?


#1

Hi
What is a reason between selected 'active-slide' ? Why one should have a dot and another not ? If I add dot to 'active-slide' like this
currentSlide.fadeOut(600).removeClass('.active-slide');
nextSlide.fadeIn(600).addClass('.active-slide');
then goes to the next slide only once and then no longer can go to the next slide. When I delete dots like this
currentSlide.fadeOut(600).removeClass('active-slide');
nextSlide.fadeIn(600).addClass('active-slide');
then everything works well

var main = function() {
    $('.dropdown-toggle').click(function() {
        $('.dropdown-menu').toggle();
        });
    $('.arrow-next').click(function() {
        var currentSlide = $('.active-slide');
        var nextSlide = currentSlide.next();
        if (nextSlide.length === 0) {
            nextSlide = $('.slide').first();
            };
        currentSlide.fadeOut(600).removeClass('active-slide');
        nextSlide.fadeIn(600).addClass('active-slide');
    
        });
        
};
$(document).ready(main);

#2

dot should be used in case of .active-slide, the dot is to tell you deal with a classname (without dot it would be html element)


#3

Thank you for the explanation


#4

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