-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo48.html
48 lines (48 loc) · 1.3 KB
/
demo48.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!doctype html>
<html ng-app="myApp">
<head>
<meta charset="UTF-8">
<title>ch12_09</title>
<link rel="stylesheet" href="css/bootstrap.css"/>
<script src="js/angular.min.js"></script>
<script type="text/javascript" src="js/angular.animate.js"></script>
<style>
.box{
width: 200px;
height: 200px;
background-color: #ccc;
}
.box.ng-enter{
transition: 0.5s linear all;
width: 0px;
height: 0px;
}
.box.ng-enter-active{
width: 200px;
height: 200px;
}
.box.ng-leave{
transition: 0.5s linear all;
width: 200px;
height:200px;
}
.box.ng-leave-active{
width: 0px;
height:0px;
}
</style>
</head>
<body ng-controller="MainController">
<div class="box" ng-if="isShow"></div><br/>
<div>
<button class="btn" ng-click="isShow=true">显示</button>
<button class="btn" ng-click="isShow=false">隐藏</button>
</div>
<script>
var myApp = angular.module('myApp',['ngAnimate']);
myApp.controller("MainController",function($scope){
$scope.isShow = false;
});
</script>
</body>
</html>