7.the o short-cut,


#1

This is the issue: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.
Please help.
Here is my code:
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();
}
});


#2

Hi Etthegeek,

You need to add a closing curly brace (}) at the end of your current code, then call main once the page is loaded, below that.

How to call main on page load

$(document).ready(main);


#3

I have wrote the main,and put the curly brace,still won't work......


#4

I made it.Thank you zyzstvan!!:slightly_smiling:


#5

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