I know. The title was a bit....hard to understand. I will see what I can do to help you understand it.
Basically, what I've done for my personal site is the main navigation as the body of the web page. And when a link is clicked, it loads some hidden content, like so:
$(document).ready(function(){
$('li a#about-toggle').click(function(){
$('li#about').animate({"height": "toggle", "opacity": "toggle"}, "slow").toggleClass("hidden");
});
$('li a#portfolio-toggle').click(function(){
$('li#portfolio').animate({"height": "toggle", "opacity": "toggle"}, "slow").toggleClass("hidden");
});
$('li a#resume-toggle').click(function(){
$('li#resume').animate({"height": "toggle", "opacity": "toggle"}, "slow").toggleClass("hidden");
});
$('li a#contact-toggle').click(function(){
$('li#contactme').animate({"height": "toggle", "opacity": "toggle"}, "slow").toggleClass("hidden");
});
});
This currently allows the visitor of the website to open all of the elements, which is not only visually displeasing, but creates a few bugs, but mostly visually displeasing.
My question is, with the code I have remaining as in-tact as possible, how would I make it so they can only have ONE open at a time?
Thanks in advance, Jacob
EDIT:
$(document).ready(function(){
$('#about-toggle').click(function(){
$("li.active").addClass("hidden");
$('#about').animate({"height": "toggle", "opacity": "toggle"}, "slow").removeClass("hidden").addClass("active");
});
$('#portfolio-toggle').click(function(){
$("li.active").addClass("hidden");
$('#portfolio').animate({"height": "toggle", "opacity": "toggle"}, "slow").removeClass("hidden").addClass("active");
});
$('#resume-toggle').click(function(){
$("li.active").addClass("hidden");
$('#resume').animate({"height": "toggle", "opacity": "toggle"}, "slow").removeClass("hidden").addClass("active");
});
$('#contact-toggle').click(function(){
$("li.active").addClass("hidden");
$('li#contactme').animate({"height": "toggle", "opacity": "toggle"}, "slow").removeClass("hidden").addClass("active");
});
});