码迷,mamicode.com
首页 > 其他好文 > 详细

angular动画

时间:2017-07-06 18:40:09      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:.com   基本   src   基于   img   ack   back   原理   com   

angularJs的动画是基于 angular-animate.js

这里是源码链接

它的基本原理是利用css的动画。transition。

方法是添加类名

技术分享

以上图片截自菜鸟教程,注意看类名

技术分享

这是点击动画效果实现后的表情。

我们在看css样式

div {
  transition: all linear 0.5s;
  background-color: lightblue;
  height: 100px;
  width: 100%;
  position: relative;
  top: 0;
  left: 0;
}

.ng-hide {
  height: 0;
  width: 0;
  background-color: transparent;
  top:-200px;
  left: 200px;
}
div {
  transition: all linear 0.5s;
  background-color: lightblue;
  height: 100px;
  width: 100%;
  position: relative;
  top: 0;
  left: 0;
}

.ng-hide {
  height: 0;
  width: 0;
  background-color: transparent;
  top:-200px;
  left: 200px;
}
transition: all linear 0.5s;

这就是angular的动画

 

angular动画

标签:.com   基本   src   基于   img   ack   back   原理   com   

原文地址:http://www.cnblogs.com/UniverseWang/p/7127197.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!