I'm just wondering as all 3 do the same thing just to different id's can it be better written/optimized?
$('#top_menu,#commun_links,#q_links').hide();
$('#top_menu_toggle').click(function () {
$(this).text($(this).text() == '+ Menu' ? '- Menu' : '+ Menu');
$('#top_menu').slideToggle('slow').css({'display' : 'block'});
return false;
});
$('#commun').click(function () {
$(this).text($(this).text() == '+ Community' ? '- Community' : '+ Community');
$('#commun_links').slideToggle('slow');
return false;
});
$('#qnav').click(function () {
$(this).text($(this).text() == '+ Quick Links' ? '- Quick Links' : '+ Quick Links');
$('#q_links').slideToggle('slow');
return false;
});
As usual all help is appreciated and thanks in advance.