Aol Shqip
Aol Shqip

Reputation: 95

jquery slidedown on page load

How can slide down a div with jquery on page load where css is set to display:none? I see a lot of solutions but none can slide div if css is set display:none. The best way is to hide it on load and after slidedown but the div have flash (show) when page is loading.

Upvotes: 3

Views: 22446

Answers (3)

Wasim A.
Wasim A.

Reputation: 9890

I didn't found above as working solution. So here it is http://www.robertprice.co.uk/robblog/using-jquery-to-scroll-to-an-element/

$('html, body').animate({
    scrollTop: ($('#element').offset().top)
},500);

Upvotes: 0

dku.rajkumar
dku.rajkumar

Reputation: 18568

$('#hidden_div_id').slideDown('slow');

this internally make use of display:block

Upvotes: 2

john
john

Reputation: 1354

You could try this:

$(document).ready(function(){
    $('.hidden').slideDown(1000);
});

HTML:

<div class="hidden">This is the content</div>

CSS:

.hidden{
 display:none;   
}

It slides down on page load.

DEMO

Upvotes: 6

Related Questions