-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsample.html
More file actions
83 lines (75 loc) · 3.06 KB
/
Copy pathsample.html
File metadata and controls
83 lines (75 loc) · 3.06 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
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
<html>
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>Pattern Input Demo</title>
<style type="text/css">
body {
background-image: -ms-linear-gradient(bottom, #D1ADFF 0%, #00A3EF 100%);
background-image: -moz-linear-gradient(bottom, #D1ADFF 0%, #00A3EF 100%);
background-image: -o-linear-gradient(bottom, #D1ADFF 0%, #00A3EF 100%);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #D1ADFF), color-stop(1, #00A3EF));
background-image: -webkit-linear-gradient(bottom, #D1ADFF 0%, #00A3EF 100%);
background-image: linear-gradient(to top, #D1ADFF 0%, #00A3EF 100%);
font-family : sans-serif;
font-size : 14pt;
font-weight : bold;
font-style : normal;
font-variant : normal;
}
</style>
<link href="pattern-input.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="pattern-input.js" type="text/javascript"></script>
<script type="text/javascript">
function BlockElasticScroll(event) {
event.preventDefault();
}
function GetSequence(panelId) {
var seq = $("#"+panelId).patternInput("getLastSequence");
if (seq) {
alert("Last sequence of "+panelId+" is "+seq.join(","));
} else {
alert("There's no last sequence for "+panelId);
}
}
function ClearSequence(panelId) {
$("#"+panelId).patternInput("clear");
}
$(document).ready(function () {
$("#patternLocker").patternInput({
onFinish: function (pattern) {
alert(pattern.join(","));
}
});
$("#patternLocker2").patternInput({
autoClear: false,
width: 400,
height: 400,
verticalDots: 4,
horizontalDots: 4,
onFinish: function (pattern) {
alert(pattern.join(","));
}
});
$("#patternLocker3").patternInput({
onFinish: function (pattern) {
alert(pattern.join(","));
}
});
});
</script>
</head>
<body ontouchmove="BlockElasticScroll(event);">
Default Setting<br>
<div id="patternLocker"></div>
<input type="button" value="Get Sequence" onclick="GetSequence('patternLocker')"><br /><br />
With options (4x4 dots, autoClear=false)<br>
<div id="patternLocker2"></div>
<input type="button" value="Get Sequence" onclick="GetSequence('patternLocker2')">
<input type="button" value="Clear Sequence" onclick="ClearSequence('patternLocker2')">
<div style="position:absolute; top: 75px; left: 450px;">Absolute Position</div>
<div id="patternLocker3" style="position:absolute; top: 100px; left: 450px;"></div>
</body>
</html>