forked from alexbardas/jQuery.fn.autoResize
-
Notifications
You must be signed in to change notification settings - Fork 3
/
demo.html
43 lines (31 loc) · 810 Bytes
/
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
<!doctype html>
<meta charset="utf-8" />
<title>autoResize demo</title>
<style>
body {
width: 700px;
font-family: sans-serif;
}
h1 {
margin: 0;
padding: 10px 0 20px;
}
textarea, input {
font-family: inherit;
font-size: 1em;
}
textarea { display: block; width: 200px; }
</style>
<h1>Textarea</h1>
<textarea id="edit1"></textarea>
<h1>Textarea with width & height</h1>
<textarea id="edit2"></textarea>
<h1>Input</h1>
<input />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script src="jquery.autoresize.js"></script>
<script>
$('textarea#edit1').autoResize({minHeight:100});
$('textarea#edit2').autoResize({minHeight:100, minWidth:200, maxWidth:400, extraSpace:0, animate: false});
$('input').autoResize({minWidth:300});
</script>