-
Notifications
You must be signed in to change notification settings - Fork 55
/
05-1-event.html
24 lines (23 loc) · 939 Bytes
/
05-1-event.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<head>
<title>Events</title>
<style>.panel{background-color:gray; display:inline-block;margin:1px; min-width:50px; min-height:50px}</style>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.11/angular.min.js"></script>
<script>
var myApp = angular.module('myApp', []);
myApp.controller('MyCtrl', function($scope){
$scope.e = 'nothing up yet';
});
</script>
</head>
<body>
<div ng-app='myApp' ng-controller='MyCtrl'>
<div class="panel" ng-click="e=$event">Click to see event: {{e.clientX}}</div>
<div class="panel" ng-dblclick="e=$event">Double Click to see event: {{e.clientX}}</div>
<div class="panel" ng-mousemove="e=$event">Movemouse over here to see event: {{e.clientX}}</div>
<div class="panel" ng-mousedown="e=$event">Mouse down to see event: {{e.clientX}}</div>
<div class="panel" ng-mouseenter="e=$event">Mouse enter to see event: {{e.clientX}}</div>
</div>
</body>
</html>