search

Home  >  Q&A  >  body text

angular.js - angularjs ng-animate not working in ng-repeat case issue

If you want to achieve the display of ng-enter during ng-repeat, delay or some background animation during ng-leave, further use ng-enter-stagging to display multiple items at the same time, but when ng-repeat builds the list No animations are shown. I couldn't find the problem and tried many demos, but nothing could be done.
The following is the HTML code:

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

The following is the css code:

.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;
}

I tried adding animation to .repeated-item, but it still didn’t work. Please help me, teachers, to answer this question! Sorry to bother everyone!

PHP中文网PHP中文网2794 days ago573

reply all(3)I'll reply

  • 迷茫

    迷茫2017-05-15 17:07:04

    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;
    }

    reply
    0
  • 高洛峰

    高洛峰2017-05-15 17:07:04

    Same question, please ask God

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-15 17:07:04

    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

    reply
    0
  • Cancelreply