$event 객체
$event 객체
$event함수를 호출 할 때 객체를 인수로 전달할 수 있습니다 .
$event객체는 브라우저의 이벤트 객체를 포함 :
예
<div ng-app="myApp" ng-controller="myCtrl">
<h1 ng-mousemove="myFunc($event)">Mouse Over Me!</h1>
<p>Coordinates: {{x + ', ' + y}}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.myFunc = function(myE) {
$scope.x = myE.clientX;
$scope.y = myE.clientY;
}
});
</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">
<h1 ng-mousemove="myFunc($event)">Mouse Over Me!</h1>
<p>Coordinates: {{x + ', ' + y}}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.myFunc = function(myE) {
$scope.x = myE.clientX;
$scope.y = myE.clientY;
}
});
</script>
<p>Mouse over the heading to display the value of clientX and clientY from the event object.</p>
</body>
</html>
$event함수를 호출 할 때 객체를 인수로 전달할 수 있습니다 .
$event객체는 브라우저의 이벤트 객체를 포함 :
예
<div ng-app="myApp" ng-controller="myCtrl">
<h1 ng-mousemove="myFunc($event)">Mouse Over Me!</h1>
<p>Coordinates: {{x + ', ' + y}}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.myFunc = function(myE) {
$scope.x = myE.clientX;
$scope.y = myE.clientY;
}
});
</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">
<h1 ng-mousemove="myFunc($event)">Mouse Over Me!</h1>
<p>Coordinates: {{x + ', ' + y}}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.myFunc = function(myE) {
$scope.x = myE.clientX;
$scope.y = myE.clientY;
}
});
</script>
<p>Mouse over the heading to display the value of clientX and clientY from the event object.</p>
</body>
</html>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 298 | CSS |
선택과집중
|
2개월 전 | 159 | |
| 297 | CSS |
선택과집중
|
3개월 전 | 362 | |
| 296 | CSS |
선택과집중
|
3개월 전 | 316 | |
| 295 | CSS |
선택과집중
|
4개월 전 | 296 | |
| 294 | CSS |
선택과집중
|
4개월 전 | 422 | |
| 293 | CSS |
선택과집중
|
4개월 전 | 379 | |
| 292 | CSS |
선택과집중
|
4개월 전 | 296 | |
| 291 | CSS |
선택과집중
|
5개월 전 | 296 | |
| 290 | CSS |
선택과집중
|
5개월 전 | 346 | |
| 289 | CSS |
선택과집중
|
5개월 전 | 314 | |
| 288 | CSS |
선택과집중
|
5개월 전 | 401 | |
| 287 | CSS |
선택과집중
|
5개월 전 | 349 | |
| 286 | CSS |
선택과집중
|
5개월 전 | 352 | |
| 285 | CSS |
선택과집중
|
5개월 전 | 369 | |
| 284 | CSS |
선택과집중
|
5개월 전 | 259 | |
| 283 | CSS |
|
2년 전 | 1527 | |
| 282 | CSS | 2년 전 | 2509 | ||
| 281 | CSS | 4년 전 | 4039 | ||
| 280 | CSS | 4년 전 | 4558 | ||
| 279 | 반응형웹 | 5년 전 | 2986 | ||
| 278 | 반응형웹 | 5년 전 | 2836 | ||
| 277 | 부트스트랩 | 7년 전 | 5033 | ||
| 276 | 부트스트랩 | 7년 전 | 6591 | ||
| 275 | 부트스트랩 | 7년 전 | 4672 | ||
| 274 | 부트스트랩 | 7년 전 | 6702 | ||
| 273 | 부트스트랩 | 7년 전 | 3369 | ||
| 272 | 부트스트랩 | 7년 전 | 3206 | ||
| 271 | 부트스트랩 | 8년 전 | 3707 | ||
| 270 | 부트스트랩 | 8년 전 | 3235 | ||
| 269 | 부트스트랩 | 8년 전 | 3113 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기