-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
41 lines (37 loc) · 953 Bytes
/
example.html
File metadata and controls
41 lines (37 loc) · 953 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>Input Abstraction Layer</title>
<!-- Scripts -->
<script src="js/zepto.min.js"></script>
<script src="js/input.js"></script>
<!-- Define Adapters -->
<script>
$.dial.adapter('touch', {
'touchstart':'SELECT'
}).adapter('mouse', {
'click':'SELECT'
}).adapter('keyboard', {
'keydown':{
'13':'SELECT',
'38':'ARROW_UP'
}
})
</script>
<!-- Pubsub Listeners -->
<script>
$.dial.on('SELECT', function(e){
console.log(arguments);
alert('you click a tag: ' + this.tagName);
});
$.dial.on('ARROW_UP', function(e){
alert('up');
});
</script>
</head>
<body>
<h1>Input Abstraction Layer</h1>
<p>...</p>
<p><a href="#">Click Me</a></p>
</body>
</html>