Thanks for the help on my previous post, @AndyE, your solution works great.
now for my follow up, same idea, different function(s)…i tried to implement your previous solution, but couldnt get it to work right…:
$(document).keypress(function(e) {
if (e.which == 27) {
$('#timeline-2010-1').hide();
$('#timeline-2010-2').hide();
$('#timeline-2010-3').hide();
$('#timeline-2010-4').hide();
$('#timeline-2010-5').hide();
$('#timeline-2010-6').hide();
$('#timeline-2010-7').hide();
$('#timeline-2010-8').hide();
$('#timeline-2010-9').hide();
$('#timeline-2010-10').hide();
$('#timeline-2010-11').hide();
$('#timeline-2010-12').hide();
$('#timeline-2010-13').hide();
$('#timeline-2010-14').hide();
$('#timeline-2010-15').hide();
$('#timeline-2010-16').hide();
$('#timeline-2010-17').hide();
}
});
$('a.close').click(function() {
$('#timeline-2010-1').hide();
$('#timeline-2010-2').hide();
$('#timeline-2010-3').hide();
$('#timeline-2010-4').hide();
$('#timeline-2010-5').hide();
$('#timeline-2010-6').hide();
$('#timeline-2010-7').hide();
$('#timeline-2010-8').hide();
$('#timeline-2010-9').hide();
$('#timeline-2010-10').hide();
$('#timeline-2010-11').hide();
$('#timeline-2010-12').hide();
$('#timeline-2010-13').hide();
$('#timeline-2010-14').hide();
$('#timeline-2010-15').hide();
$('#timeline-2010-16').hide();
$('#timeline-2010-17').hide();
return false;
});
});
I would give those elements a class, e.g.:
Then you can slim it down to: