感谢您的支持,我会继续努力的!
打开微信扫一扫,即可进行扫码打赏哦
点我查看本站打赏源码!
Powered by RUNCODEX.COM,学的不仅是技术,更是梦想!!!
<script src="https://cdn.staticfile.org/angular.js/1.6.6/angular.min.js"></script>
<div ng-app="myApp" ng-controller='event'>
<div ng-show='flag' style='background: #ccc;width: 20px;height: 20px;border-radius: 50%;'>球</div>
<button ng-click='toggle()'>{{text}}</button>
</div>
xxxxxxxxxx
var app = angular.module('myApp', []);
app.controller('event', ['$scope', function ($scope) {
$scope.flag = false;
$scope.text = '点击可见';
$scope.toggle = function(){
$scope.flag = !$scope.flag;
$scope.text = $scope.flag ? '点击消失' : '点击可见';
}
}])
输入 CSS 代码……