2 part question here...I have several DIVs that use a simple .click show() function to display content. Is there a way i can combine these to trim my code? I wasnt sure, because they all are displaying DIV with Unique ID's.
$('a#hmo-blue-lnk1').click(function() {
$('#hmo-blue1').show();
return false;
});
$('a#hmo-blue-lnk2').click(function() {
$('#hmo-blue2').show();
return false;
});
$('a#hmo-blue-lnk3').click(function() {
$('#hmo-blue3').show();
return false;
});
i close them via this snippet:
$('a.close').click(function() {
$('#hmo-blue1').hide();
$('#hmo-blue2').hide();
$('#hmo-blue3').hide();
return false;
});
2nd part of the question... how can i integrate the aspect that the user can just hit the escape key to also hice (or close) the box that is shown?