gpt4 book ai didi

AngularJS 1.2.14 ng-repeat 项目的动画

转载 作者:行者123 更新时间:2023-12-02 23:59:30 24 4
gpt4 key购买 nike

我有一个表,我希望行因搜索结果而消失:

<tbody>
<tr ng-click="open(item._id)" ng-animate="'animate'" ng-repeat="item in itemList | filter:searchText" >
<td>{{$index + 1}}</td>
<td>{{item.name}}</td>
<td>{{item.description}}</td>
<td>{{item._id}}</td>
</tr>
</tbody>

我的应用程序引用了 app.js 中的 ngAnimate 模块 - 文件:

var app = angular.module("app", ["ngAnimate", "appController", "appFactory", "appConfig"]);

index.html的来源:

<link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="/css/custom/custom.css" rel="stylesheet">
<script src="/js/libs/bootstrap/bootstrap.js"></script>
<script src="/js/libs/angular/angular.min.js"></script>
<script src="//code.angularjs.org/1.2.14/angular-animate.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular-route.js"></script>
<script src="js/controller/app.js"></script>

因此我使用这个CSS:

.animate-enter, .animate-leave {

transition: 500ms ease-in all;
position: relative;
display: block;
}

.animate-enter.animate-enter-active, .animate-leave {
left: 0;
}
.animate-leave.animate-leave-active, .animate-enter {
left: 500px;
}

不幸的是,什么也没发生。

最佳答案

ng-animate="'animate'" 替换为 class="animate"那么CSS应该是:

.animate.ng-enter, .animate.ng-leave {
transition: 500ms ease-in all;
position: relative;
display: block;
}

.animate.ng-enter.ng-enter-active, .animate.ng-leave {
left: 0;
}
.animate.ng-leave.ng-leave-active, .animate.ng-enter {
left: 500px;
}

从版本 1.2 开始,ng-animate 属性被替换为类 Docs for ngAnimate

关于AngularJS 1.2.14 ng-repeat 项目的动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22326661/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com