-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
53 lines (50 loc) · 1.36 KB
/
demo.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
<html>
<head></head>
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=1, user-scalable=no" />
<script src="MMGestureRecognizer.js"></script>
<script>
//display
function display(ob){
var arr=[];
for(var i in ob){
arr.push((i +" - "+ob[i]).slice(0,30));
}
__log(arr.join('<br>'));
}
function __log(a){
document.body.innerHTML="---------------------------------------<br>"//+ document.body.innerHTML;
document.body.innerHTML="<h1>"+a +"</h1>"//+ document.body.innerHTML;
}
window.onload=function(){
var recognizer = new MMGestureRecognizer( document.body);
recognizer.on('swipedown',function(d){
__log('swipe down ');
});
recognizer.on('swipeup',function(d){
__log('swipe up ');
});
recognizer.on('swipeleft',function(d){
__log('swipe left ');
});
recognizer.on('swiperight',function(d){
__log('swipe right ');
});
recognizer.on('pinch',function(param){
__log('pinch '+param.pinch );
});
recognizer.on('longpress',function(){
__log('longpress' );
});
recognizer.on('throwup',function(){
__log('throwd up' );
});
recognizer.on('throwdown',function(){
__log('throw down' );
});
recognizer.on('pan',function(){
__log('pan' );
});
};
</script>
<body></body>
</html>