O shortcut :(


#1

Please help me I'm stucked :(.

This 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();
}
});
}
$(document).keypress(function(even) {
$(document).ready(main);

#2

Hi Joshua,

What is the first line shown there doing? You need to delete it, it's going to cause a syntax error and make your code not work.


#3

Hi,

Thanks, but what line do you exactly mean.
I don't seem to understand, because it still does not work


#4

@blogplayer24073 Delete line 15 in your code. If you're still having trouble, please post your updated code.


#5

Got it thank you very much :slightly_smiling:


#6

A post was split to a new topic: Need help with this code