How do I hide a div before the page is loaded?
I have a div on my page - I'd like when that page is being 开发者_如何学运维loaded that Div is being hidden by jQuery's .hide method. Now I have that when a page is ready then that div is hiding - but that hiding is visible. I don't want that
Now I have that code:
$(document).ready(function(event)
{
$('#Div1').hide('fast');
});
.hide('fast')
will still animate. To do it (nearly) instantly use .hide();
. However, you may still see a flicker, in which case what you want to do is append
style="display:none"
to the element in question as part of the initial html sent. This still allows you to use jQuery's .show();
method later on if you wish.
精彩评论