-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdemo.html
43 lines (38 loc) · 882 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>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AutoResize Demo</title>
<style type="text/css">
textarea {
display: block;
font-size: 12px;
line-height: 1.6;
min-height: 50px;
width: 20%;
margin: 10px auto;
padding: 10px;
font-family: arial;
color: #444;
background-color: #EEE;
border: solid 1px #CCC;
}
</style>
</head>
<body>
<textarea placeholder="type into me!"></textarea>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="jquery.autoresize.js"></script>
<script>
var textarea;
function onDomReady() {
textarea = jQuery('textarea').autoResize();
textarea.bind('autoresize:resize', onAutoResize);
}
function onAutoResize(event, height) {
console.log('resize:', event, height);
}
jQuery(document).ready(onDomReady);
</script>
</body>
</html>