javascript - How do I animate the removal of an item with unknown height from an ng-repeat using ng-animate? -
i have looked @ example:
how can animate movement of remaining ng-repeat items when 1 removed?
but not do. have this:
<div class="please-work" ng-repeat="item in array track item.id"> {{item}} <button ng-click="removeitem(item)">del</button> </div>
when use ng-animate so:
.please-work.ng-leave { transition:0.5s linear all; opacity:1; } .please-work.ng-leave.ng-leave-active { opacity:0; }
the item fades out nicely, other elements after jump position.
the answer linked @ top has workaround, requires knowledge of element's height in pixels. basically, says animate height of element original height 0 in order create desired sliding effect. problem elements have varying heights, , don't know how reference starting height start of css animation. there way this? thank in advance, it's been long evening fighting this.
edit: misunderstood given example. animating max-height (not height) sort of works this, little imprecise. there cleaner method?
also, don't want height change, visually, though i'm pretty sure can work around using invisible wrapper.also, if want animate rest of remaining elements in other way?
Comments
Post a Comment