-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
84 lines (74 loc) · 2.02 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>miniCount - jQuery Plugin</title>
<link rel="stylesheet" href="css/site.css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="container">
<header>
<h1>
<strong>miniCount demo</strong> - jQuery Plugin
</h1>
</header>
<div id="main" class="clearfix">
<section id="example-1">
<h2>Default</h2>
<textarea autofocus="autofocus"></textarea>
</section>
<section id="example-2">
<h2>Custom Minimum <strong>or</strong> Maximum</h2>
<div class="row">
<input class="character" type="text" value="min of 5 characters."/>
</div>
<div class="row">
<input class="word" type="text" value="max 5 words and no more."/>
</div>
</section>
<section id="example-3">
<h2>Custom Minimum <strong>and</strong> Maximum</h2>
<textarea>Minimum of 2 sentences. Maximum of 5. Yes, you can do both!</textarea>
</section>
</div>
</div>
<!-- end of #container -->
<script src="js/libs/jquery.min.js"></script>
<script src="js/miniCount.js"></script>
<script>
$(function() {
// Example 1
$('#example-1 textarea').miniCount();
// Example 2
$('input.character').miniCount({
min : 5,
unit : 'character',
text : '',
invalidText : 'characters (5 minimum)',
hideOnValid : true,
countdown : true
});
$('input.word').miniCount({
max : 5,
unit : 'word',
text : 'words left',
invalidText : 'words',
countdown : true
});
// Example 1
$('#example-3 textarea').miniCount({
min : 2,
max : 5,
unit : 'sentence',
text : 'current count:',
invalidText : 'current count:',
textPosition : 'before',
counterPosition: 'before'
});
});
</script>
</body>
</html>