|
Add onload event trigger + timer
Hi all i have this script below that slide up and slide down a panel on click :
<script type="text/javascript">
// When the DOM is ready, initialize the scripts.
jQuery(function( $ ){
// Get a reference to the container.
var container = $( "#panel" );
// Bind the link to toggle the slide.
$( ".btn-slide" ).click(
function( event ){
// Prevent the default event.
event.preventDefault();
// Toggle the slide based on its current
// visibility.
if (container.is( ":visible" )){
// Hide - slide up.
container.slideUp( 500 );
$(this).removeClass("active");
} else {
// Show - slide down.
container.slideDown( 500 );
$(this).addClass("active");
}
}
);
});
</script>
What i want to do is also to make the panel slide up on page load...delay for 3 seconds then slide down..
Being a newbie .. I have no idea on how to add this bit of code...
Any help appreciated..
Thks
//Sam
|