This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Objects in PHP Forum

View Course » View Exercise

1144 points
54e469a59113cb8bcc002406_162590290
Submitted by
OfficialCodeAcademy
almost 3 years ago

Someone explain to me how to do 8/10

Please post an explanation of how to do this and possibly the correct code.


-3 votes

permalink

I think this is way to easy for anyone to have explained but I was stuck as well on this one all I did was modify the event handler to create an if statement event.which === 110 which turns out to look like this
else if(event.which === 110) {
}

thats all I input so it will look like this :

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){
else if(event.which === 110) {
}
$('.description').hide();
$('.current').children('.description').toggle();
}
});

};

$(document).ready(main)

126 points
675a4bd6f277fde5f01e70f5e2df9048?s=140&d=retro
Submitted by
stanfordvega
almost 3 years ago

1 Comment

54e362b6e39efed280002576_62031016 Chris over 2 years ago

I think you picked the wrong exercise ^^