eddyperu
asked on
How can I slide up and down a panel with Jquery
Hi
I need a simple panel to go up and down using JQuery, the sample online just show me how it goes down but not how it goes up.
Thanks
I need a simple panel to go up and down using JQuery, the sample online just show me how it goes down but not how it goes up.
Thanks
Script:
<script type="text/javascript">
$(document).ready(function () {
$(".btn-slide").click(function () {
$("#panel").slideToggle("slow");
$(this).toggleClass("active");
return false;
});
});
</script>
CSS:
<style type="text/css">
#sample {
margin: 0 auto;
padding: 0;
width: 570px;
font: 75%/120% Arial, Helvetica, sans-serif;
}
a:focus {
outline: none;
}
#panel {
background: #754c24;
height: 200px;
display: none;
}
.slide {
margin: 0;
padding: 0;
border-top: solid 4px #422410;
background: url(images/btn-slide.gif) no-repeat center top;
}
.btn-slide {
background: url(images/white-arrow.gif) no-repeat right -50px;
text-align: center;
width: 144px;
height: 31px;
padding: 10px 10px 0 0;
margin: 0 auto;
display: block;
font: bold 120%/100% Arial, Helvetica, sans-serif;
color: #fff;
text-decoration: none;
}
.active {
background-position: right 12px;
}
</style>
aspx:
<div id="panel">
<!-- you can put content here -->
</div>
<p class="slide">
<a href="#" class="btn-slide">Slide Panel</a>
</p>
SlideUP.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.