O shortcut lesson #7


#1

Here is my code. The toggle works, but i keep getting the message "looks like the o key isn't opening a description.

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

    $(document).keypress(function(event){
        if (event.which === 111) {
            $('.current').children('.description').toggle();
        }

    });

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

}
$(document).ready(main);


#2

@p51,

Please read
http://discuss.codecademy.com/t/help-me-on-o-shortcut/25483/2?u=leonhard.wettengmx.n


#3

I'm having the same problem: my code is very similar to p51's, my toggle works with the o key, but I'm getting that same error code.

@leonhard.wettengmx.n I read your explanation, but I guess I don't understand why the code above doesn't fit the structure of code you described. Some specific feedback would be much appreciated. Thanks!


#4

Guys, I think I have found the answer