angular.js - angularjs ng-animate在ng-repeat情况下不起作用问题
PHP中文网
PHP中文网 2017-05-15 17:05:04
0
3
520

想要达到ng-repeat时ng-enter,ng-leave时延迟或者一些背景动画的显示,进一步使用ng-enter-stagging,让多项不同时显示出来,但是在ng-repeat构建列表时动画都没有展示。查不到问题,找了很多demo来试,都没有办法。
下面是HTML代码:

<pre>
<p ng-repeat="item in items" class="repeated-item">
  {{ item}}
</p>
</pre>

下面是css代码:

.repeated-item{
    border: solid 1px;
    opacity: 1;
    transition:3s linear all;
}
/*动画开始前*/

.repeated-item.ng-enter, .repeated-item.ng-move {
  -webkit-transition:3s linear all;
  -moz-transition:3s linear all;
  -o-transition:3s linear all; 
  background-color: red;
  opacity:0;
}

试过把动画加到.repeated-item上去,还是不起效。请各位老师帮忙解答一下!麻烦大家了!

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
迷茫

Are you sure your transition is correct? How do I see the syntax is:

Then it should be:

.repeated-item{
    border: solid 1px;
    opacity: 1;
    transition: all 3s linear;
}
小葫芦

Same question, please ask God

过去多啦不再A梦

The animation of repeat is created from scratch. Add a button and write the data into items and you should be able to have animation

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!