forked from cpojer/mootools-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
99 lines (80 loc) · 2.5 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html>
<head>
<title>MooTools Mobile</title>
<link rel="stylesheet" media="all" type="text/css" href="style.css" />
<link rel="stylesheet" media="all" type="text/css" href="demo.css" />
<style type="text/css">
body {
-webkit-tap-highlight-color: transparent;
}
span.yes {
color: #363;
}
span.yes:after {
content: ' - yes';
}
span.no {
color: #C30;
}
span.no:after {
content: ' - no';
}
div#support {
width: 300px;
}
div#support span {
display: block;
}
body > div {
float: left;
}
div > a {
display: block;
}
</style>
<script type="text/javascript" src="mootools-core.js"></script>
<script type="text/javascript" src="custom-event.js"></script>
<script type="text/javascript" src="../Source/Browser/Mobile.js"></script>
<script type="text/javascript" src="../Source/Browser/Features.Touch.js"></script>
<script type="text/javascript" src="../Source/Touch/Touch.js"></script>
<script type="text/javascript" src="../Source/Touch/Click.js"></script>
<script type="text/javascript">
window.addEvent('domready', function(){
var browser = document.id('support');
var add = function(text, hasSupport){
return new Element('span.' + (hasSupport ? 'yes' : 'no'), {text: text}).inject(browser);
};
// Check if some of the additional properties on the Browser object are set
add('Touch Support', Browser.Features.Touch);
add('iOS Touch Support', Browser.Features.iOSTouch);
add('Browser has high resolution', Browser.hasHighResolution);
add('Browser is mobile', Browser.isMobile);
add('Browser Device Name: ' + Browser.Device.name, Browser.Device.name != 'other');
// On iOS this automatically gets replaced with the touchend event. No work required on your side!
document.id('myElement').addEvent('click', function(event){
event.preventDefault();
add('Click event was replaced with touchend: ', event.type == 'touchend');
});
var listener = function(){},
removeTest = new Element('div');
removeTest.addEvent('click', listener).removeEvent('click', listener);
add('Removed listener successfully: ', !removeTest.hasEvent('click'));
});
</script>
</head>
<body>
<div id="more">
<span>Demos</span>
<a href="index.html">Home</a>
<a href="swipe.html">Swipe</a>
<a href="pinch.html">Pinch</a>
<a href="touchhold.html">Touchhold</a>
</div>
<div id="support">
</div>
<div>
<a id="myElement" href="#">Click here to see which event handler was used</a>
</div>
</body>
</html>