如何隐藏&LT; DIV&GT;从视图中的元素,但还是老样子让他们占用空间AngularJS? [英] How can I hide <div> elements from view but stil have them take up space with AngularJS?
本文介绍了如何隐藏&LT; DIV&GT;从视图中的元素,但还是老样子让他们占用空间AngularJS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下内容:
<div class="block-border">
<div class="grid-select">
<div class="clearfix">
...
...
</div>
</div>
</div>
在形式方面是它们填充一旦屏幕加载数据的控制。而人口仍在进行中我有具有非零值的变量$ scope.loading。当负载完成这个值将是零。
On the form area are controls which are populated with data once the screen loads. While the population is still ongoing I have a variable $scope.loading which has a non zero value. When the load finishes this value will be zero.
有没有我能躲就&LT控件的方法; DIV CLASS =网格选择&GT;
所以他们是不可见的。请注意,我还是希望他们使用的空间,我仍然想显示块边界DIV。
Is there a way that I could hide the controls on the <div class="grid-select">
so they are not visible. Note that I still want them to use up space and I still want to show the block-border DIV.
推荐答案
尝试CSS可见性:隐藏;
是这样的:
<style>
.hidden{
visibility:hidden;
}
</style>
<div class="grid-select" ng-class="{'hidden': loading!=0 }">
例如: http://jsfiddle.net/cherniv/YJ2R7/
这篇关于如何隐藏&LT; DIV&GT;从视图中的元素,但还是老样子让他们占用空间AngularJS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文