JNY
JNY

Reputation: 71

JQuery SlideDown on program startup

I was thinking, would it be possible to set an object to SlideDown on startup? I already know how to set it as SlideUp using

display:none

I was wondering if the other way around was possible.

Thanks! Nico :D

Upvotes: 0

Views: 111

Answers (2)

Parrotmaster
Parrotmaster

Reputation: 676

$('document').ready(function() {
    $('#your_element').hide();
    $('#your_element').slideDown();
});

Will make your element slide down as soon as the document is done loading (aka: program startup).

See this JSFiddle for a live demo.

Upvotes: 0

Mark Walters
Mark Walters

Reputation: 12400

Hide the element onload and then slidedown.

$(function(){
   $('#eleToSlide').hide();
   $('#eleToSlide').slideDown();
});

or just

$(function(){
   $('#eleToSlide').slideDown();
}); 

if the element is hidden with css already

Upvotes: 1

Related Questions