<!DOCTYPE HTML>
<html ng-app="myApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
.box{ width:200px; height:200px; background:red; transition:1s all;}
.box.ng-hide-remove{ opacity:0;}
.box.ng-hide-remove-active{ opacity:1;}
.box.ng-hide-add{ opacity:1;}
.box.ng-hide-add-active{ opacity:0;} </style>
<script src="http://cdn.bootcss.com/angular.js/1.3.8/angular.min.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.3.8/angular-animate.min.js"></script>
<script> var m1 = angular.module('myApp',['ngAnimate']);
m1.controller('Aaa',['$scope',function($scope){ $scope.bBtn = true; }]); </script>
</head> <body>
<div ng-controller="Aaa">
<input type="checkbox" ng-model="bBtn">
<div ng-show="bBtn" class="box"></div>
</div>
</body>
</html>
<!DOCTYPE HTML>
<html ng-app="myApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
.box{ width:200px; height:200px; background:red;}
</style>
<script src="jquery-1.11.1.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.3.8/angular.min.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.3.8/angular-animate.min.js"></script>
<script> var m1 = angular.module('myApp',['ngAnimate']); m1.animation('.box',function(){
return {
addClass : function(element,sClass,done){
//console.log(element);
//console.log(sClass);
//console.log(done);
$(element).animate({width:0,height:0},1000,done);
},
removeClass : function(element,sClass,done){
$(element).css({width:0,height:0});
$(element).animate({width:200,height:200},1000,done);
}
};
}); m1.controller('Aaa',['$scope',function($scope){ $scope.bBtn = true; }]); </script>
</head> <body>
<div ng-controller="Aaa">
<input type="checkbox" ng-model="bBtn">
<!--<div ng-if="bBtn" class="box"></div>-->
<div ng-show="bBtn" class="box"></div>
</div>
</body>
</html>
<!DOCTYPE HTML>
<html ng-app="myApp">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
.box{ width:200px; height:200px; background:red;}
</style>
<script src="jquery-1.11.1.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.3.8/angular.min.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.3.8/angular-animate.min.js"></script>
<script> var m1 = angular.module('myApp',['ngAnimate']); m1.animation('.box',function(){
return {
leave : function(element,done){
//console.log(element);
//console.log(sClass);
//console.log(done);
$(element).animate({width:0,height:0},1000,done);
},
enter : function(element,done){
$(element).css({width:0,height:0});
$(element).animate({width:200,height:200},1000,done);
}
};
}); m1.controller('Aaa',['$scope',function($scope){ $scope.bBtn = true; }]); </script>
</head> <body>
<div ng-controller="Aaa">
<input type="checkbox" ng-model="bBtn">
<!--<div ng-if="bBtn" class="box"></div>-->
<div ng-if="bBtn" class="box"></div>
</div>
</body>
</html>

最新文章

  1. java环境变量设定
  2. Device Channels in SharePoint 2013
  3. 通讯簿(apple)
  4. iOS设计模式——委托(delegate)
  5. (转) 如何在JavaScript与ActiveX之间传递数据1
  6. Bootstrap简易使用指南
  7. Spring环境配置
  8. Android项目---TouchListener
  9. matlab获取向量中出现次数最多的元素
  10. ajax bookstrap美化网页,并实现页面的加载,删除与查看详情
  11. POJ - 1190 生日蛋糕 dfs+剪枝
  12. day4 liaoxuefeng---函数式编程
  13. [原创]一种专门用于前后端分离的web服务器(JerryServer)
  14. (N叉树 BFS) leetcode429. N-ary Tree Level Order Traversal
  15. 【函数参数】什么是*args和**kwargs?
  16. react-redux笔记
  17. P2P贷款全攻略,贷前、贷中、贷后工作事项解析
  18. OC OD介绍
  19. [svc]通过ssh tunnel连接内网ECS和RDS
  20. 利用构造函数对canvas里面矩形与扇形的绘制进行一个封装

热门文章

  1. shell脚本——项目1
  2. Angular(一)
  3. 我们为什么需要 lock 文件
  4. Java工厂模式浅析理解
  5. 我只能说,Spring Data REST真的很燥辣
  6. Android从相册选取视频
  7. [BZOJ2152]聪聪可可 点分治/树形dp
  8. 什么是web前端,全栈工程师就业前景怎么样?
  9. POJ 2761 Feed the dogs (主席树)(K-th 值)
  10. bean实例化--工厂方法