

I am running into a problem when using toggle.
I want to click the button and show the first panel. Then I want to put a button in that panel that closes the current panel and opens a new one. And when that panel opens there will also be a button that closes the second. (back to before any button was pressed.)
Below is the code I am working with. I can only use it to open and close one panel.
an example of what i already have can be found at http://spyrestudios.com/demos/sliding-panel-fixed/
Code:
$(document).ready(function(){ $(".trigger").click(function(){ $(".panel").toggle("fast"); $(this).toggleClass("active"); return false; }); });