AngularJS Toggle, True/False
AngularJS Toggle, True/False
버튼을 클릭 할 때 HTML 코드 섹션을 표시하고 드롭 다운 메뉴처럼 버튼을 다시 클릭하면 숨기기 버튼이 토글 스위치처럼 동작하도록하십시오.
Example
<div ng-app="myApp" ng-controller="myCtrl">
<button ng-click="myFunc()">Click Me!</button>
<div ng-show="showMe">
<h1>Menu:</h1>
<div>Pizza</div>
<div>Pasta</div>
<div>Pesce</div>
</div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.showMe = false;
$scope.myFunc = function() {
$scope.showMe = !$scope.showMe;
}
});
</script>
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<button ng-click="myFunc()">Click Me!</button>
<div ng-show="showMe">
<h1>Menu:</h1>
<div>Pizza</div>
<div>Pasta</div>
<div>Pesce</div>
</div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.showMe = false;
$scope.myFunc = function() {
$scope.showMe = !$scope.showMe;
}
});
</script>
<p>Click the button to show/hide the menu.</p>
</body>
</html>
showMe변수는 부울 값 아웃 시작 false.
이 myFunc함수는 (not) 연산자를 showMe사용하여 변수를 그 반대의 값으로 설정합니다 !.
버튼을 클릭 할 때 HTML 코드 섹션을 표시하고 드롭 다운 메뉴처럼 버튼을 다시 클릭하면 숨기기 버튼이 토글 스위치처럼 동작하도록하십시오.
Example
<div ng-app="myApp" ng-controller="myCtrl">
<button ng-click="myFunc()">Click Me!</button>
<div ng-show="showMe">
<h1>Menu:</h1>
<div>Pizza</div>
<div>Pasta</div>
<div>Pesce</div>
</div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.showMe = false;
$scope.myFunc = function() {
$scope.showMe = !$scope.showMe;
}
});
</script>
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<button ng-click="myFunc()">Click Me!</button>
<div ng-show="showMe">
<h1>Menu:</h1>
<div>Pizza</div>
<div>Pasta</div>
<div>Pesce</div>
</div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.showMe = false;
$scope.myFunc = function() {
$scope.showMe = !$scope.showMe;
}
});
</script>
<p>Click the button to show/hide the menu.</p>
</body>
</html>
showMe변수는 부울 값 아웃 시작 false.
이 myFunc함수는 (not) 연산자를 showMe사용하여 변수를 그 반대의 값으로 설정합니다 !.
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 298 | CSS |
선택과집중
|
1개월 전 | 147 | |
| 297 | CSS |
선택과집중
|
3개월 전 | 351 | |
| 296 | CSS |
선택과집중
|
3개월 전 | 300 | |
| 295 | CSS |
선택과집중
|
3개월 전 | 278 | |
| 294 | CSS |
선택과집중
|
3개월 전 | 404 | |
| 293 | CSS |
선택과집중
|
4개월 전 | 340 | |
| 292 | CSS |
선택과집중
|
4개월 전 | 270 | |
| 291 | CSS |
선택과집중
|
4개월 전 | 280 | |
| 290 | CSS |
선택과집중
|
4개월 전 | 319 | |
| 289 | CSS |
선택과집중
|
4개월 전 | 296 | |
| 288 | CSS |
선택과집중
|
4개월 전 | 382 | |
| 287 | CSS |
선택과집중
|
4개월 전 | 335 | |
| 286 | CSS |
선택과집중
|
5개월 전 | 335 | |
| 285 | CSS |
선택과집중
|
5개월 전 | 352 | |
| 284 | CSS |
선택과집중
|
5개월 전 | 240 | |
| 283 | CSS |
|
2년 전 | 1512 | |
| 282 | CSS | 2년 전 | 2487 | ||
| 281 | CSS | 4년 전 | 4017 | ||
| 280 | CSS | 4년 전 | 4543 | ||
| 279 | 반응형웹 | 5년 전 | 2974 | ||
| 278 | 반응형웹 | 5년 전 | 2818 | ||
| 277 | 부트스트랩 | 7년 전 | 5016 | ||
| 276 | 부트스트랩 | 7년 전 | 6570 | ||
| 275 | 부트스트랩 | 7년 전 | 4652 | ||
| 274 | 부트스트랩 | 7년 전 | 6684 | ||
| 273 | 부트스트랩 | 7년 전 | 3354 | ||
| 272 | 부트스트랩 | 7년 전 | 3194 | ||
| 271 | 부트스트랩 | 7년 전 | 3694 | ||
| 270 | 부트스트랩 | 7년 전 | 3215 | ||
| 269 | 부트스트랩 | 7년 전 | 3086 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기