-
Notifications
You must be signed in to change notification settings - Fork 29
/
prototype.html
57 lines (49 loc) · 1.17 KB
/
prototype.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!doctype html>
<head>
<meta name="viewport" content="width=device-width">
</head>
<body>
<style>
#test {
background: green;
width: 480px;
height: 480px;
margin: 0 auto;
overflow: hidden;
color: white;
}
body {
overflow: hidden;
}
</style>
<div id="test">
</div>
<!-- Pointer events library. -->
<script src="build/pointer.js"></script>
<script>
var test = document.querySelector('#test');
test.addEventListener('pointerdown', function(e) {
log('pointerdown, pointerType: ' + e.pointerType);
});
test.addEventListener('pointermove', function(e) {
log('pointermove, pointerType: ' + e.pointerType);
log('pointer count: ' + e.getPointerList().length);
});
test.addEventListener('pointerup', function(e) {
log('pointerup, pointerType: ' + e.pointerType);
});
function log(msg) {
test.innerHTML = msg + '<br/>' + test.innerHTML;
}
test.addEventListener('gesturedoubletap', function() {
log('doubletap');
});
test.addEventListener('gesturelongpress', function() {
log('longpress');
});
test.addEventListener('gesturescale', function(e) {
log('scale: ' + e.scale);
});
</script>
</body>
</html>