I have two sliding panels. I need ONLY ONE panel open at a time. Right now they can both open. My project link is: link text
Here is my code:
$(document).ready(function(){
$(".btn-slide").click(function(){
$("#panel_quote").slideToggle("slow");
$(this).toggleClass("closeQ"); return false;
});
});
$(document).ready(function(){
$(".btn-slide2").click(function(){
$("#panel_login").slideToggle("slow");
$(this).toggleClass("closeL"); return false;
});
});
I looked at the link you provided but I couldn’t see the buttons.
Anyway. What you probably want is to show only either
"#panel_quote"or"#panel_login". In that case I would recommend usinghide()onload on one of them and then in one button toggle both like this:Or if you really want to use both buttons, just add the other toggle to each button handler. And again, you can use the
hide()onload. It is safer to proceed this way rather than giving initial css values to hide the panel because of users with javascript turned off.