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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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
回答2:
$('#hidden_div_id').slideDown('slow');
this internally make use of display:block
回答3:
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);