forked from ftlabs/fastclick
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path111.html
More file actions
37 lines (36 loc) · 1.37 KB
/
111.html
File metadata and controls
37 lines (36 loc) · 1.37 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
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=3">
<style type="text/css">
p { font-family: sans-serif; }
.test { font-size: 2em; border-radius: 0.4em; padding: 1em 1.5em; line-height: 2em; width: 1em; color: white; display: inline-block; }
#test1 { background: rgb(253, 109, 109); margin-right: 0.2em; }
#test2 { background: rgb(173, 255, 47); margin-left: 0.2em; }
#testcontainer { text-align: center; }
</style>
<title>#111</title>
<script type="application/javascript" src="../lib/fastclick.js"></script>
<script type="application/javascript">
window.addEventListener('load', function() {
var test1 = document.getElementById('test1');
FastClick.attach(test1);
test1.addEventListener('click', function(event) {
if (event.forwardedTouchEvent) {
setTimeout(function() {
test1.style.webkitTransform = test1.style.webkitTransform ? '' : 'rotate(20deg)';
}, 0);
}
}, false);
}, false);
</script>
</head>
<body>
<p>If you attempt a pinch zoom on iOS with both fingers on the same element, pinch zooming should work. If each finger is touching a different element, the pinch zooming should also work.</p>
<p>Only the red block below has FastClick enabled.</p>
<div id="testcontainer">
<div class="test" id="test1">◎</div>
<div class="test" id="test2">◎</div>
</div>
</body>
</html>