-
Notifications
You must be signed in to change notification settings - Fork 3
/
TouchEvents.html
167 lines (146 loc) · 3.64 KB
/
TouchEvents.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="pt-br" />
<meta http-equiv="Window-target" content="_self" />
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>TouchEvents</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="robots" content="index, follow" />
<meta name="author" content="Wallace Erick" />
<link type="text/css" href="css/style.css" rel="stylesheet">
<script type="text/javascript" src="js/zepto.min.js"></script>
<script type="text/javascript">
Zepto(function($){
var speed = 300;
var easing = "'ease-out'";
$('ul.events li').append('<span class="delete">Deletar</span>');
//Tap
$('.events li.tap').tap(function(){
$('.delete').animate({
opacity: 0,
right: '-70px'
}, speed, easing);
$('.delete', this).animate({
opacity: 1 ,
right: '10px'
}, speed, easing);
});
//singleTap
$('.events li.singleTap').singleTap(function(){
$('.delete').animate({
opacity: 0,
right: '-70px'
}, speed, easing);
$('.delete', this).animate({
opacity: 1 ,
right: '10px'
}, speed, easing);
});
//doubleTap
$('.events li.doubleTap').doubleTap(function(){
$('.delete').animate({
opacity: 0,
right: '-70px'
}, speed, easing);
$('.delete', this).animate({
opacity: 1 ,
right: '10px'
}, speed, easing);
});
//longTap
$('.events li.longTap').longTap(function(){
$('.delete').animate({
opacity: 0,
right: '-70px'
}, speed, easing);
$('.delete', this).animate({
opacity: 1 ,
right: '10px'
}, speed, easing);
});
//swipe
$('.events li.swipe').swipe(function(){
$('.delete').animate({
opacity: 0,
right: '-70px'
}, speed, easing);
$('.delete', this).animate({
opacity: 1 ,
right: '10px'
}, speed, easing);
});
//swipeLeft
$('.events li.swipeLeft').swipeLeft(function(){
$('.delete').animate({
opacity: 0,
right: '-70px'
}, speed, easing);
$('.delete', this).animate({
opacity: 1 ,
right: '10px'
}, speed, easing);
});
//swipeRight
$('.events li.swipeRight').swipeRight(function(){
$('.delete').animate({
opacity: 0,
right: '-70px'
}, speed, easing);
$('.delete', this).animate({
opacity: 1 ,
right: '10px'
}, speed, easing);
});
//swipeUp
$('.events li.swipeUp').swipeUp(function(){
$('.delete').animate({
opacity: 0,
right: '-70px'
}, speed, easing);
$('.delete', this).animate({
opacity: 1 ,
right: '10px'
}, speed, easing);
});
//swipeDown
$('.events li.swipeDown').swipeDown(function(){
$('.delete').animate({
opacity: 0,
right: '-70px'
}, speed, easing);
$('.delete', this).animate({
opacity: 1 ,
right: '10px'
}, speed, easing);
});
//Delete a linha no evento TAP
$('.delete').tap(function(){
$(this).parent('li').animate({
opacity: 0,
height: '0px',
padding: '0px',
margin: '0px'
}, speed, easing);
});
});
</script>
</head>
<body>
<ul class="events">
<li class="tap"><a href="#">Tap</a></li>
<li class="singleTap"><a href="#">Single Tap</a></li>
<li class="doubleTap"><a href="#">Double Tap</a></li>
<li class="longTap"><a href="#">Long Tap [750ms +]</a></li>
<li class="swipe"><a href="#">Swipe</a></li>
<li class="swipeUp"><a href="#">Swipe Up</a></li>
<li class="swipeDown"><a href="#">Swipe Down</a></li>
<li class="swipeLeft"><a href="#">Swipe Left</a></li>
<li class="swipeRight"><a href="#">Swipe Right</a></li>
</ul>
</body>
</html>