源代码 :
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> @keyframes myChange { from { height: 100px; } to { height: 0; } } div { height: 100px; background-color: lightblue; } div.ng-hide { animation: 0.5s myChange; } </style> <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script> <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular-animate.min.js"></script> </head> <body ng-app="ngAnimate"> 隐藏 DIV: <input type="checkbox" ng-model="myCheck"> <div ng-hide="myCheck"> </div> </body> </html>
运行结果