sliding between route transition angularjs

后端 未结 3 2028
后悔当初
后悔当初 2021-02-02 16:58

I\'ve only been working with Angular for about a week, so I apologize if my code is crap.

I\'m attempting to create a sliding action between route transitions. I can cre

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 17:23

    For anyone googleing this....

    Add the classes ng-enter/ng-leave/.ng-enter-active/.ng-leave-active to your css classes. Example

    .slide-animate.ng-enter, .slide-animate.ng-leave{
     -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
      -moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
       -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
          transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 2s;
     }
    
    
    .slide-animate.ng-enter.ng-enter-active {
     position: absolute;
     left: 1300px;
    }
    
    .slide-animate.ng-enter {
     left: 0;
    }
    
    .slide-animate.ng-leave.ng-leave-active {
     position: absolute;
     left: -1700px;
     }
    
    .slide-animate.ng-leave {
     right: 0;
     }
    

    Egghead.io also has some great video on animation if you want a in depth tutorial

提交回复
热议问题