The dots


#1

Hi there, two things are strange here, the first is that codecademy keeps giving me the error "Oops, try again. Remember to remove '.active-dot' from the current dot." when I submit this code, even though I have included a line to do that, and the second is that at the end of the last exercise my code passed even though it didn't appear to work! Any observations would be appreciated. Thanks very much :smile:

 var main = function () {
  $('.dropdown-toggle').click(function() {
      $('.dropdown-menu').toggle();
  });
  $('arrow-next').click(
      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

Hi Halfgraben,

You've got a few problems in your code, but they're all easily fixable :)

  • You're accidentally selecting the HTML element <arrow-next> on line 5, you need to add a dot (.) before it so you're selecting the HTML element with the class .arrow-next
  • You're missing the function on line 5. Try adding this to the end of that line: function() {
  • On line 11, you need an opening single quote (') just before .slide, but still in the parenthesis
  • Line 19, you need to close main() with a closing curly brace (})

I hope this helps, please let me know if you're still having issues or have questions about anything :)


#3

Thanks so much! :smile:
All working now.