Ben*_*y B 5 css css-transitions angularjs ng-animate ionic-framework
这里是角度动画菜鸟。
我可以使用 成功地将内容制作成动画到页面上ngAnimate。但是,当我的新内容滑入时,其下方的所有内容都会跳至新位置。同样,当新内容被删除时,后续内容会跳回来。是否有一种有角度的方式来动画以下内容的新位置?
<button class="button" ng-if="typingResponse">
Submit!
</button>
<div class="response-section">
<label class="item item-input item-stacked-label">
<span class="input-label">Response</span>
<textarea></textarea>
</label>
</div>
.button.ng-enter {
-webkit-animate: slideInLeft 1s;
animation: slideInLeft 1s;
}
.button.ng-leave {
-webkit-animate: slideOutLeft 1s;
animation: slideOutLeft 1s;
}
Run Code Online (Sandbox Code Playgroud)
@klauskpm 让我了解了大部分内容,而这篇博文正是缺失的部分。
解决方案:
max-height将div 的首字母设置为0pxmax-height属性的转换max-heightdiv的属性更新的代码:
<div class="button-container" ng-class="{'has-button': typingResponse}">
<button class="button" ng-if="typingResponse">
Submit
</button>
</div>
<div class="response-section">
<label class="item item-input item-stacked-label">
<span class="input-label">Response</span>
<textarea></textarea>
</label>
</div>
.button.ng-enter {
-webkit-animate: slideInLeft $slide-dur;
animation: slideInLeft $slide-dur;
}
.button.ng-leave {
-webkit-animate: slideOutLeft $slide-dur;
animation: slideOutLeft $slide-dur;
}
.button-container {
max-height: 0px;
transition: max-height $slide-dur linear;
-webkit-transition: max-height $slide-dur linear;
}
.button-container.has-button {
max-height: 100px;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1199 次 |
| 最近记录: |