10/10 Added Improvements when pressing N


#1

Hi all,

I was playing around in 10/10 and added the following two lines just to make the transition look a little smoother so that when N is pressed it hides all descriptions and open the next current one. :smile:

else if (event.which === 110) {
  // ***added this myself to hide the description when moving on to the next current article
  $('.current').children('.description').hide();
  var currentArticle = $('.current');
  var nextArticle = currentArticle.next();
  currentArticle.removeClass('current');
  nextArticle.addClass('current');
  // ***added this myself to re-show the description once N is pressed and the new current is selected
  $('.current').children('.description').show();
}

#2

hard to decipher if not all codes are posted


#4

Hi jhepong, I'll gladly help if I can make it a little easier to understand?