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사용하여 변수를 그 반대의 값으로 설정합니다 !.
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 88 | jQuery Mobile | 8년 전 | 1939 | ||
| 87 | jQuery Mobile | 8년 전 | 1919 | ||
| 86 | jQuery Mobile | 8년 전 | 1531 | ||
| 85 | jQuery Mobile | 8년 전 | 1840 | ||
| 84 | jQuery Mobile | 8년 전 | 1875 | ||
| 83 | jQuery Mobile | 8년 전 | 1889 | ||
| 82 | jQuery Mobile | 8년 전 | 1659 | ||
| 81 | jQuery Mobile | 8년 전 | 1375 | ||
| 80 | jQuery Mobile | 8년 전 | 1813 | ||
| 79 | jQuery Mobile | 8년 전 | 1360 | ||
| 78 | jQuery Mobile | 8년 전 | 1758 | ||
| 77 | jQuery Mobile | 8년 전 | 1783 | ||
| 76 | jQuery Mobile | 8년 전 | 1793 | ||
| 75 | jQuery Mobile | 8년 전 | 1406 | ||
| 74 | jQuery Mobile | 8년 전 | 1544 | ||
| 73 | jQuery Mobile | 8년 전 | 1251 | ||
| 72 | jQuery Mobile | 8년 전 | 1630 | ||
| 71 | jQuery Mobile | 8년 전 | 1625 | ||
| 70 | jQuery Mobile | 8년 전 | 1508 | ||
| 69 | jQuery Mobile | 8년 전 | 1515 | ||
| 68 | jQuery Mobile | 8년 전 | 2052 | ||
| 67 | jQuery Mobile | 8년 전 | 1319 | ||
| 66 | jQuery Mobile | 8년 전 | 1697 | ||
| 65 | jQuery Mobile | 8년 전 | 1189 | ||
| 64 | jQuery Mobile | 8년 전 | 1471 | ||
| 63 | jQuery Mobile | 8년 전 | 1661 | ||
| 62 | jQuery Mobile | 8년 전 | 1646 | ||
| 61 | jQuery Mobile | 8년 전 | 1882 | ||
| 60 | jQuery Mobile | 8년 전 | 1412 | ||
| 59 | jQuery Mobile | 8년 전 | 1969 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기