I currently have 2 panels (div's) at the top of my website. When you click a link it will drop down the panel, when you click the other link, i want it to slide up any open div's then once it's slide up, open the div clicked.
I currently have this:
$(document).ready(function(){
$(".btnSlideL").click(function(){
$("#clientLogin").slideUp('fast');
$("#languages").slideToggle("fast");
$(this).toggleClass("active");
});
});
$(document).ready(function(){
$(".btnSlideC").click(function(){
$("#languages").slideUp('fast');
$("#clientLogin").slideToggle("fast");
$(this).toggleClass("active");
});
});
and HTML:
<div id="languages" class="topPanel">
<div class="topPanelCont">
languages
</div>
</div>
<div id="clientLogin" class="topPanel">
<div class="topPanelCont">
client login
</div>
</div>
<div id="container">
<div id="containerCont">
<div id="headerTop">
<a href="#" title="#" class="btnSlideL">Languages</a>
<a href="#" title="#" class="btnSlideC">Client Login</a>
</div>
But i think its a bit long-winded.
And what happens, is the Div, opens once clicked, but if you click the other, it opens it over the top, while the other closes beneath.
A good example of what i want to achieve is here:
click the links at the top.