html <div ng-app="myApp" ng-controller="myCtrl"> <div ng-show="toggleStatus" class="animate-example"> </div> </div> css .animate-example.ng-hide { opacity: 0; } .animate-example.ng-show { opacity: 1; transition: opacity 1s; } script var app = angular.module('myApp', ['ngAnimate']); app.controller('myCtrl', function($scope) { $scope.toggleStatus = true; $scope.toggle = function() { $scope.toggleStatus = !$scope.toggleStatus; }; });


上一篇:
下一篇:
切换中文