The n shortcut 2


#1


The n shortcut 2

Oops, try again. It looks like the n key isn't moving to the next article. Remember to remove the 'current' class from currentArticle and place it on nextArticle.
What am i missing??

var main = function() {
$('.article').click(function() {
     $('.article').removeClass('current');
    $('.description').hide();

    $(this).addClass('current');
    $(this).children('.description').show();
  }
}  
    

$(document).keypress(function(event) {
  if(event.which === 111) {
    $('.current').children('.description').toggle();
  }
  else if(event.which === 110) {
  var currentArticle = $('.current');
  var nextArticle = currentArticle.next();

  currentArticle.removeClass('current');
  nextArticle.addClass('current');
}
});


#2

seems like you did not get a response to this. Seems to be a frequent issue with code academy giving broken instructions of sorts.


#3

@creat You have the same problem here as you did in the previous exercise:

https://discuss.codecademy.com/t/the-o-shortcut/52714/2?u=zystvan


#4

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