Having trouble with 7. o shortcut can anyone help please


#1

var main = function() {

};

$(document).ready(main);
var main = function() {
$('.article').click(function() {
$(this).children('.description').show();
});
};
var main = function() {
$('.article').click(function() {
$('.description').hide();

$(this).children('.description').show();

});
var main = function() {
$('.article').click(function() {
$('.article').removeClass('current');
$('.description').hide();

$(this).addClass('current');
$(this).children('.description').show();

}
var main = function() {
$('.article').click(function() {
...
});

$(document).keypress(function(event) {
});
}
like this:

$(document).keypress(function(event) {
if(event.which === 111) {
$('.current').children('.description').toggle();
}

});
};
var main = function() {
$('.article').click(function() {
$('.description').hide();
$(this).children('.description').show();
});
};


#2

Hi Whiskey15,

Why do you have so many main functions? You can only have one.
That's part of the problem - fix that by combining all of the (non-duplicate) code into one main function, then post your updated code please :slightly_smiling: