-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (47 loc) · 1.14 KB
/
index.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
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Ractive Single finger Swipe Events</title>
<style type="text/css">
#swipe {
width: 1800px;
height: 1000px;
position: fixed;
}
</style>
</head>
<body>
<div id="container"></div>
<script type="text/ractive" id="touchT">
<div id="swipe" on-swipeleft="left" on-swiperight="right" on-swipeup="up" on-swipedown="down">
<h1>{{direction}}</h1>
</div>
</script>
<script src="./Ractive.min.js"></script>
<script src="./Ractive-events-swipe.js"></script>
<script>
var ractive = new Ractive({
el: '#container',
template: '#touchT',
data : {
name: 'koti',
direction: 'Please swipe screen with single finger'
}
});
ractive.on({
left: function(e){
ractive.set('direction', 'You have swiped Left')
},
right: function(e){
ractive.set('direction', 'You have swiped Right')
},
down: function(e){
ractive.set('direction', 'You have swiped Down')
},
up: function(e){
ractive.set('direction', 'You have swiped Up')
}
})
</script>
</body>
</html>