7. The O shortcut


#1

I have the problem with "Oops, try again. It looks like the o key isn't opening a description. Remember to toggle the current article's description inside the event handler. Look back at the instructions for the code." message. In Full screen window my code works. Please, help me to find an error in the code...

var main = function() {
$('.article').removeClass('.current');
$('.description').hide();
$(this).addClass('current');
$(this).children('.description').show();
$('.article').click(function() {
$(document).keypress(function(event) {
if(event.which === 111) {
$('.current').children('.description').toggle();
}
});
});
};
$(document).ready(main);


#2

Hi Roman,

Check line 8 - add/remove/toggleClass() don't use a dot (.) in front of the class name :)


#4

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