How do to exercise 9 and 11?


#1

i do it wrong using this form(ex 9)

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();
    nextDot=$('.dot').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 Mingirl,

On line 9, you're closing your $('.arrow-next').click(...); section of code too early, so you need to remove that line :slightly_smiling: