[英]Reserve white space while hidden div is loading
In the code below, a div is hidden until it gets OK from a 3rd-party server, and then it's rendered via jquery. 在下面的代码中,div被隐藏,直到它从第三方服务器获得OK,然后通过jquery呈现。 The purpose is to create an impression of smooth loading.
目的是给人一种平滑加载的印象。 The problem is that the paragraph below this div is pushed down after the div is loaded, which defeats the purpose of the trick.
问题是该div下方的段落在div加载后被下推,这违背了技巧的目的。 What's the best way to fix that?
解决这个问题的最佳方法是什么?
http://jsfiddle.net/Sh7aA/7/ http://jsfiddle.net/Sh7aA/7/
<div id="fb-root"></div>
<p style="text-align:center">Follow us!</p>
<center style="display: none;" id="social">
<div class="g-plusone" data-size="medium"></div>
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>
</center>
<p style="text-align:center">Test paragraph of text<br>
Paragarph continued</p>
设置加载内容的容器的min-height
,以匹配加载内容的高度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.