This repository has been archived by the owner on Feb 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
test.html
104 lines (87 loc) · 3.02 KB
/
test.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>event:taphold</title>
<meta charset="utf-8" />
<style>
.events div {
width: 100px;
height: 100px;
margin: 20px;
float: left;
padding: 10px;
font-weight: bold;
}
.events #one {
background: #f00;
}
.events #two {
background: #0f0;
}
.events #three {
background: #000;
color: #fff;
}
.events #four {
background: #fff;
color: #000;
border: 1px solid #000;
}
.events #five {
background: #dcda07;
color: #000;
}
.events #six {
background: #f10fff;
color: #000;
}
.events #seven {
background: #3cc9f4;
color: #000;
}
.events #debug {
clear: both;
background: #000;
color: #fff;
width: 100%;
display: block;
margin-top: 2em;
min-height: 100px;
padding-bottom: 1em;
font-family: monospace;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js" type="text/javascript"></script>
<script src="taphold.js" type="text/javascript"></script>
<script type="text/javascript">
$(function()
{
$("#one").bind("taphold", function() { $("#debug").append("\ntap and hold on ONE"); });
$("#two").on("taphold", function() { $("#debug").append("\ntap and hold on TWO"); });
$("#three").on("taphold",
{clickHandler: function() { $("#debug").append("\nclick on THREE"); }},
function() { $("#debug").append("\ntap and hold on THREE"); });
$("#four").on("taphold", function() { $("#debug").append("\ntap and hold on FOUR"); })
.on("click", function() { $("#debug").append("\nclick on FOUR"); });
$("#five").draggable();
$("#five").on("taphold", function() { $("#debug").append("\ntap and hold on FIVE"); })
.on("click", function() { $("#debug").append("\nclick on FIVE"); });
$("#six").droppable();
$("#six").on("taphold", function() { $("#debug").append("\ntap and hold on SIX"); })
.on("click", function() { $("#debug").append("\nclick on SIX"); });
$("#seven").on("taphold", {duration: 5000}, function() { $("#debug").append("\ntap and hold on SEVEN"); });
});
</script>
</head>
<body class="events">
<div id="one">ONE<br/><br/>tap-hold</div>
<div id="two">TWO<br/><br/>tap-hold (alt)</div>
<div id="three">THREE<br/><br/>tap-hold<br/>click</div>
<div id="four">FOUR<br/><br/>tap-hold<br/>click (alt)</div>
<div id="five">FIVE<br/><br/>draggable<br/>tap-hold<br/>click (alt)</div>
<div id="six">SIX<br/><br/>droppable<br/>tap-hold<br/>click (alt)</div>
<div id="seven">SEVEN<br/><br/>5s<br/>tap-hold</div>
<pre id="debug"></pre>
</body>
</html>