The n shortcut 2


#1

I have a problem, the code does't passing:

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');
        }
    });
};

$(document).ready(main);

#2

Hi Nick,

Your code worked without any trouble for me, so I'd recommend refreshing the page or switching browsers :slightly_smiling:


#3

Hi, zystvan. It was strangely but the trouble was with my browser (Chrome 48). I switched it to Firefox, and the code successfully passed. Thank you for advice!