What i want is hide all content first, then click one tab, the corresponding content shows (the tab becomes \'active\'), where click it again it will disappear. some of the
Change the click function to:
$('#nav ul li a').click(function(){
var currentTab = $(this).attr('href');
$('#nav div').not(currentTab).hide();
$('#nav ul li').removeClass('active');
$(this).parent().toggleClass('active');
if (currentTab.indexOf("mailto:") === -1)
{
$(currentTab).toggle();
}
});
Working example