Stuck on The o shortcut (exercise 7)


#1

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


$(document).ready(main);

I have no idea what I'm doing wrong. ive tried to remove the (.) dots for the add/remove/toggle...it doesn't seem to work. Please help ! :cry:


The o shortcut, step 7
#2

Hi Kylerausch4,

The problem is on this line:

$(.description').hide();

Can you spot the problem there?


#3

oh my goodness...I feel silly haha... thank you very much I really appreciate your help!

Cheers,

Kyle


#4

A post was split to a new topic: Need help on exercise 7


#5

A post was split to a new topic: Can't figure out what's wrong with my code on #7