2016-02-12 93 views
0

我是Ionic的新手。我尝试使用本教程中添加动画:ng-animate在我的IONIC应用程序中不起作用

http://gonehybrid.com/how-to-animate-your-ionic-app-with-animate-css-and-nganimate/

所有工作做好,直到nganimate一步。我不知道为什么,但如果我添加一个自定义类,例如没有发生任何事情。这里是我的代码(PS我din't编辑我app.js. NG-动画包括在离子吧?):

<ion-content has-bouncing="false"> 
     <a class="whiteBack" /> 
     <div class="staffList"> 

      <a class="item item-avatar animate patate"> 
       <img src="https://cdn4.iconfinder.com/data/icons/general04/png/256/clients.png"> 
       <h2>Stefano Z.</h2> 
       <p>iOS & Android App Developer</p> 
      </a> 
    </ion-content> 

CSS:

/*animation*/ 
    patate.ng-enter { 
     -webkit-animation: fadeInLeft 1s; 
     animation: fadeInLeft 1s; 
    } 

也许我想念我的一些指标。 HTML:

<!DOCTYPE html> 
<html> 
    <head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> 
    <title></title> 

    <link href="css/animate.css" rel="stylesheet"> 
    <link href="lib/ionic/css/ionic.css" rel="stylesheet"> 
    <link href="css/style.css" rel="stylesheet"> 

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above 
    <link href="css/ionic.app.css" rel="stylesheet"> 
    --> 

    <!-- ionic/angularjs js --> 
    <script src="lib/ionic/js/ionic.bundle.js"></script> 
    <script src="http://code.ionicframework.com/0.9.23/js/angular/angular-animate.min.js"></script> 
    <!-- cordova script (this will be a 404 during development) --> 
    <script src="cordova.js"></script> 

    <!-- your app's js --> 
    <script src="js/app.js"></script> 
    <script src="js/controllers.js"></script> 
    </head> 

    <body ng-app="starter"> 
    <ion-nav-view></ion-nav-view> 
    </body> 
</html> 

回答

0

NG-动画包括在离子框架, 只需要应用animated类,它应该来的动画效果之前,即:class="animated fade-in-out"

所以,也许这样的:

<a class="item item-avatar animate patate"> 

应该是:

<a class="item item-avatar animated patate"> 
+0

不起作用。我不知道为什么,但ng-enter类没有应用 – Steph8

0

Ionic在ng-animate(bug)方面存在很多问题。尝试使用angular1.3.0和Ionic1.3.2

相关问题