forked from ftlabs/fastclick
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6.html
More file actions
29 lines (29 loc) · 1.05 KB
/
6.html
File metadata and controls
29 lines (29 loc) · 1.05 KB
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style type="text/css">
p { font-family: sans-serif; }
textarea { width: 25em; height: 15em; }
</style>
<title>#6</title>
<script type="application/javascript" src="../lib/fastclick.js"></script>
<script type="application/javascript">
window.addEventListener('load', function() {
new FastClick(document.body);
Array.prototype.forEach.call(document.getElementsByClassName('button'), function(button) {
button.addEventListener('click', function(event) {
console.log(event.target.nodeName + ' was tapped (forwarded: ' + (event.forwardedTouchEvent ? 'yes' : 'no') + ')');
}, false);
});
}, false);
</script>
</head>
<body>
<textarea>FastClick is instantiated on the document body. Tap this textarea to gain focus.</textarea>
<p>Open the browser console to see debug info.</p>
<input type="button" class="button" value="Now tap this <input> button">
<br><br>
<button class="button">Now tap this <button> button</button>
</body>
</html>