-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
54 lines (47 loc) · 1.33 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Auto-Resizing Text Box</title>
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css" />
<style>
input {
border: 3px solid black;
padding: 20px;
font: 24px Arial;
min-width: 100px;
max-width: 300px;
}
textarea {
border: 3px solid black;
padding: 20px;
font: 24px Arial;
min-height: 100px;
max-height: 300px;
}
</style>
</head>
<body>
<div>
<input type="text" autofocus /> <code>min-width: 100px; max-width: 300px;</code>
</div>
<div>
<textarea></textarea> <code>min-width: 100px; max-width: 300px;</code>
</div>
<script src="http://code.jquery.com/jquery-1.11.0.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
<script src="src/jquery.autosize.js"></script>
<script>
$(function() {
// TODO: Set Box Model CSS property
$('input').autoWidth();
$('textarea').autoHeight();
// setInterval(function() {
// $('input, textarea').each(function() {
// $(this).width($(this).width() + 1);
// });
// }, 3000);
});
</script>
</body>
</html>