forked from alexbardas/jQuery.fn.autoResize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
56 lines (41 loc) · 851 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
44
45
46
47
48
49
50
51
52
53
54
55
56
<!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;
}
#t, #i, #e, #u {
font-family: inherit;
font-size: 1em;
}
#t { display: block; width: 100%; }
</style>
<h1>Textarea</h1>
<textarea id="t"></textarea>
<h1>Inputs</h1>
<h2>Text</h2>
<input id="i" />
<h2>Email</h2>
<input id="e" type="email">
<h2>URL</h2>
<input id="u" type="url">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script src="jquery.autoresize.js"></script>
<script>
$('textarea,input').autoResize({
onBeforeResize: function(){
console.log('Before');
$(this).css('background', 'red');
},
onAfterResize: function(){
console.log('After');
$(this).css('background', '');
}
});
</script>