Interactive Website - Unit 3 - Conclusion help


#1

I am on Unit 3 of the "Make an interactive Website" Course. I need to make sure im doing this right. Im at the part near the very end where i have to make the "N" key go through the articles. My problem is that the "N" key only applies the CSS class "current" which Shades the title of the article Gray to indicate that its open. It doesn't open the description of the next article, and the current article actually stays open even though the title of the next article turns gray to indicate that the next article is open even though its not.

It's a bit hard to explain through words. The main issue im having is that at the preview of the practice part, where it shows how the website is supposed to work, does the same thing.

If anyone can go to that part of the training and tell me if its happening to them, then at least i know that its not a mistake im making.

Thank you to anyone who takes the time out to help. It goes a long way!

Ill go ahead and paste my "app.js" file so you can see what im working with:

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) {
$('.description').hide();

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

else if(event.which === 110) {
  var currentArticle = $('.current');
  var nextArticle = currentArticle.next();
  
  currentArticle.removeClass('current');
  nextArticle.addClass('current');
}

});
}

$(document).ready(main);


#2

This doesn't look like Ruby at all, you probably posted in the wrong section. You can move your thread by editing it and changing its section.