如何在加载像facebook时创建占位符 [英] how to create placeholder while loading like facebook
本文介绍了如何在加载像facebook时创建占位符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在使用角度js加载内容时创建像facebook这样的后台加载行。
How to create background loading lines like facebook did while loading the content using angular js.
推荐答案
您可以查看此博客文章,详细介绍Facebook上的占位符如何运作:
You could have a look at this blog post which describes in detail how the placeholders on Facebook work:
http://cloudcannon.com/deconstructions/2014/11/15/facebook-content-placeholder-deconstruction.html
基本上,你输入一些静态html样式与css看起来类似于即将发布的内容。
Essentially, you put in some static html styled with css to look similar to the content that is coming.
<div class="placeholder">
<!-- some boxes in light grey to look like content -->
</div>
加载完成后,删除占位符:
When you are finished loading, you remove the placeholder:
$(".placeholder").remove();
这篇关于如何在加载像facebook时创建占位符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文