AngularJS 1.2查看离开/输入动画?

时间:2013-09-23 23:49:58

标签: javascript html css angularjs

基本上我想滑出一个视图并在新视图中滑动,但是“离开事件”根本没有发生,旧视图消失(在离开效果之前)并且新视图带有过渡效果

FILE = index.html

<!--Placeholder for Views-->
<div id="main" ng-view="" class="slide-animation">

</div>

FILE = app.css

/* Animations */
.slide-animation.ng-enter, .slide-animation.ng-leave {
  transition: 0.5s cubic-bezier(0.420, 0.000, 1.000, 1.000) all;
}

.slide-animation.ng-enter {
  left: 100%;
}

.slide-animation.ng-enter.ng-enter-active {
  left: 0;
}

.slide-animation.ng-leave {
  left: 0;
}

.slide-animation.ng-leave.ng-leave-active {
  left: -100%;
}

感谢任何帮助,谢谢。

1 个答案:

答案 0 :(得分:1)

尝试将position: absolute;添加到您的第一个css区块。