我有这个使用 Angular 和 Bootstrap 的简单 HTML 标记:
Toggle panel: <input type="checkbox" ng-model="toggle"><br/>
<br/>
<div class="container">
<section id="content">
<div class="panel panel-default animate-show" ng-show="toggle">
<div class="panel-heading">
<h3 class="panel-title">Panel title1</h3>
</div>
<div class="panel-body">
Content1
</div>
</div>
<div class="panel panel-default animate-show" ng-hide="toggle">
<div class="panel-heading">
<h3 class="panel-title">Panel title2</h3>
</div>
<div class="panel-body">
Content2
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Panel title3</h3>
</div>
<div class="panel-body">
Content3
</div>
</div>
</section>
</div>
还有这个小的 Angular 控制器:
function MainController($scope) {
$scope.toggle = true;
}
请参阅此 JSFiddle:http: //jsfiddle.net/dennismadsen/1hr9q1ra/1/。
当面板显示/隐藏时,如何在面板上添加动画?