thanks to a gracious user on another forum, i found this code for a collapsable vertical menu for use on my indexhibit site using javascript and jquery:
he uses it on his site here.
one thing i am trying to tweak is to have it automatically close an open section when clicking on a new section; so if i was on "print", clicking "screen" would open "screen" and close "print" automatically.
i am sure its one simple line of code but i have no clue how to do that. any ideas?
Code:
$(document).ready(function()
{
// First we hide all exhibitis
$("#menu ul li.section-title").nextAll().hide();
// then the active exhibit is showed
$("#menu ul").each(function(){
$(this).find("li.active").prevAll().nextAll().show();
});
//This is the toggle function
$("#menu ul li.section-title").click(function(){
$(this).nextAll().slideToggle("fast");
});
});
he uses it on his site here.
one thing i am trying to tweak is to have it automatically close an open section when clicking on a new section; so if i was on "print", clicking "screen" would open "screen" and close "print" automatically.
i am sure its one simple line of code but i have no clue how to do that. any ideas?