replace a buch of show/hide with switch/case in javascript
- by Adam
Page has menu items that would replace a 'div id=foo_(current menu item)' with 'div id=foo_(selected menu item)' in 'div class=foo'
Here's what I've got, and try to keep your breakfast down...
$('#t1').click(function() {
$('#attorney').show();
$('#insurance,#financial,#estate,#trust,#death').hide();
});
$('#t2').click(function() {
$('#insurance').show();
$('#attorney,#financial,#estate,#trust,#death').hide();
});
$('#t3').click(function() {
$('#financial').show();
$('#attorney,#insurance,#estate,#trust,#death').hide();
});
$('#t4').click(function() {
$('#estate').show();
$('#attorney,#insurance,#financial,#trust,#death').hide();
});
$('#t5').click(function() {
$('#trust').show();
$('#attorney,#insurance,#financial,#estate,#death').hide();
});
$('#t6').click(function() {
$('#death').show();
$('#attorney,#insurance,#financial,#estate,#trust').hide();
});