Pull down pane - with tab
by karlgo
HTML
<div id="toppanel">
<div id="panel">
Panel Content
</div>
<div class="tab">
<ul class="login">
<li class="left"> </li>
<li>x</li>
<li class="sep">|</li>
<li id="toggle">
<a id="open" class="open" href="#">Settings</a>
<a id="close" style="display: none;" class="close" href="#">Close Panel</a>
</li>
<li class="right"> </li>
</ul>
</div> <!-- Tab below the panel -->
</div> <!--panel -->
<div id="container">
<div id="content">
This is the content
</div>
</div> <!-- container -->
CSS
html, body {border: 0; margin: 0; padding: 0;}
body {
font: 85%/0.9 arial, helvetica, sans-serif;
background: #99A989 url(../images/bg.jpg) repeat 0 0;
line-height: 130%;
width: 100%;
min-width: 970px;
color: black;
}
a {
color: #0099CC;
text-decoration: none;
}
a:hover {
color: #00CCFF;
}
a img {
border: none;/*remove border for linked images*/
}
h1 {
font-size: 1.6em;
height: 20px;
padding-top: 0;
}
h2{
font-size: 1.2em;
height: 20px;
padding-top: 0;
}
.highlight {background-color:#FF9D9D;border-bottom:#F30 1px solid;border-top:#F30 1px solid;padding: 4px 10px}
/***** Main Layout ****/
#container {
width: 100%;
height: 100%;
text-align: center;/* IE fix to center the page */
}
#content {
width: 740px;
margin: 0 auto;/* center the page in Firefox */
text-align: left;
padding: 20px;
}
/* Panel Tab/button */
.tab {
background: url(../images/tab_b.png) repeat-x 0 0;
height: 42px;
position: relative;
top: 0;
z-index: 999;
}
.tab ul.login {
display: block;
position: relative;
float: right;
clear: right;
height: 42px;
width: auto;
font-weight: bold;
line-height: 42px;
margin: 0;
right: 150px;
color: white;
font-size: 80%;
text-align: center;
}
.tab ul.login li.left {
background: url(../images/tab_l.png) no-repeat left 0;
height: 42px;
width: 30px;
padding: 0;
margin: 0;
display: block;
float: left;
}
.tab ul.login li.right {
background: url(../images/tab_r.png) no-repeat left 0;
height: 42px;
width: 30px;
padding: 0;
margin: 0;
display: block;
float: left;
}
.tab ul.login li {
text-align: left;
padding: 0 6px;
display: block;
float: left;
height: 42px;
background: url(../images/tab_m.png) repeat-x 0 0;
}
.tab ul.login li a {
color: #15ADFF;
}
.tab ul.login li a:hover {
color: white;
}
.tab .sep {color:#414141}
.tab a.open, .tab a.close {
height: 20px;
line-height: 20px !important;
padding-left: 30px !important;
cursor:...
JavaScript
$(document).ready(function() {
// Expand Panel
$("#open").click(function(){
$("div#panel").slideDown("slow");
});
// Collapse Panel
$("#close").click(function(){
$("div#panel").slideUp("slow");
});
// Switch buttons from "Log In | Register" to "Close Panel" on click
$("#toggle a").click(function () {
$("#toggle a").toggle();
});
});