菜鸟学堂
在线运行
源代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> 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; } </style> <script src="http://edu.jb51.net/libs/angular.js/1.4.6/angular.min.js"></script> <script src="http://edu.jb51.net/libs/angular.js/1.4.6/angular-animate.min.js"></script> </head> <body ng-app="myApp"> <h1>隐藏 DIV: <input type="checkbox" ng-model="myCheck"></h1> <div ng-hide="myCheck"></div> <script> var app = angular.module('myApp', ['ngAnimate']); </script> </body> </html>
运行结果
在线运行
菜鸟学堂 edu.jb51.net