/
demo.html
107 lines (97 loc) · 2.54 KB
/
demo.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
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>jquery.capsChecker Demo</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery.capsChecker.min.js"></script>
<script type="text/javascript">
$(function() {
function onCaps(e, on)
{
if(on)
$('#pnlIndicator').addClass('on')
else
$('#pnlIndicator').removeClass('on')
}
$('#txtTest').capsChecker({ capson: onCaps, capsoff: onCaps });
$('#btnRemove').on('click', function() {
$('#txtTest').capsChecker('destroy');
});
});
</script>
<style>
body {
background: #fff;
font: 14px/20px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #444;
-webkit-font-smoothing: antialiased; /* Fix for webkit rendering */
-webkit-text-size-adjust: 100%;
padding: 20px 40px 40px;
margin: 0;
}
h1
{
color: #181818;
font-family: "Georgia", "Times New Roman", serif;
font-weight: normal;
font-size: 35px;
line-height: 40px;
margin-bottom: 20px;
}
p
{
margin: 0 0 20px 0;
}
.input
{
position: relative;
width: 280px;
height: 50px;
}
input
{
border: 1px solid #ccc;
padding: 15px;
outline: none;
font-size: 16px;
height: 20px;
color: #777;
margin: 0;
width: 250px;
max-width: 100%;
display: block;
background: #fff;
}
button { margin-top: 20px }
.indicator
{
height: 20px;
width: 40px;
text-align: center;
position: absolute;
right: 5px;
top: 5px;
background: red;
color: #fff;
padding: 10px 5px;
display: none;
}
.indicator.on { display: block }
</style>
</head>
<body>
<h1>jquery.capsChecker Demo</h1>
<p>Start typing some text inside the input field to see if caps lock is on.</p>
<div class="input">
<input id="txtTest" type="text" />
<div id="pnlIndicator" class="indicator">CAPS</div>
</div>
<button id="btnRemove">remove capsChecker</button>
</body>
</html>