I'm having trouble hiding the contents of some divs in a pseudo-tab set up - my code is at http://rudderlive.bito.org.nz/employment%5Fdev2.asp
Tab 1 to Tab 2 works fine, but moving from Tab 2 to Tab 3 does not hide the div of Tab 2, and moving from Tab 3 back to Tab 1 doesn't hide the Tab 2 or 3 divs.
My code is as follows - but it makes more sense when viewed together with the HTML (at the above page)...
$('ul.tabNav a').click(function() {
var curChildIndex = $(this).parent().prevAll().length + 1;
$(this).parent().parent().children('.current').removeClass('current');
$(this).parent().addClass('current');
$('div.tabContainer').children('.current').fadeOut('fast',function() {
$(this).removeClass('current');
$('div.tabContainer').children('div:nth-child('+curChildIndex+')').fadeIn('normal',function() {
$(this).addClass('current');
});
});
return false;
});