Please help! - New Dot 1


#1

Can someone help me find the error in my code? I don't know what I did wrong. The error message says, "Oops, try again. Remember to remove '.active-dot' from the current dot." Thanks!

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');

  });

$(document).ready(main)


#2

var currentDot = $('active-dot');  // $('.active-dot') // missed a .

#3

That did it! Thank you!


#4

I made the same mistake but when I corrected it it's still giving me the same error.

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');
});

}

$(document).ready(main);


#5

You need a dot before the arrow-next click function. This is what you wrote:

This is what you should have:

 $('.arrow-next').click(function() {

Try it out and let me know if it works!


#6

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