-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
105 lines (104 loc) · 3.5 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!doctype html>
<html lang="en">
<head>
<title>YUI 3: Simple Textarea Autoheight</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<style type="text/css">
html {
overflow-y: scroll;
}
header {
border-bottom: 1px solid #aaa;
}
footer {
border-top: 1px solid #aaa;
padding-top: 10px;
}
a {
font-size: 13px;
color: maroon;
}
header, footer, .doc {
width: 900px;
margin: auto;
}
.demo {
margin: 40px auto;
}
pre {
background: #eee;
border: 1px solid #ccc;
padding: 5px;
}
.fork {
float: right;
font-size: 15px;
}
textarea {
width: 500px;
}
</style>
</head>
<body>
<header>
<a class="fork" href="https://github.com/prajwalit/textarea-autoheight">Fork it on Github</a>
<h2>YUI 3: Textarea Autoheight</h2>
<p>A YUI 3 plugin which adds 'auto-height' functionality to textareas.</p>
</header>
<div class="doc">
<div class="demo">
<h4>Demo: Start typing in this textarea: </h4>
<textarea rows="1" placeholder="Start typing here..."></textarea>
</div>
<h4>To Use Gallery Module:</h4>
<pre>
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
<script type="text/javascript">
YUI ({
gallery: "gallery-2012.05.09-20-27"
}).use ("gallery-textarea-autoheight", function (Y) {
Y.one("textarea").plug (Y.TextareaAutoheight);
});
</script></pre>
<h4>To Use Downloaded Code:</h4>
<pre>
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
<script type="text/javascript" src="textareaAutoheight-min.js"></script>
<script type="text/javascript">
YUI ().use ("textareaAutoheight", function (Y) {
Y.one("textarea").plug (Y.TextareaAutoheight);
});
</script></pre>
<br />
<p>* If you pass maxRows parameter, it will add scrollbar after those many number of rows.</p>
<pre>Y.one("textarea").plug (Y.TextareaAutoheight, {maxRows: 4});</pre>
<br />
<p>* To adjust height manually:</p>
<pre>Y.one("textarea").textareaAutoheight.adjustHeight();</pre>
</div>
<footer>
<a href="https://github.com/prajwalit/textarea-autoheight">Download Code</a>
| <a href="http://prajwalit.com">Prajwalit.com</a>
| @<a href="http://twitter.com/prajwalit">prajwalit</a>
</footer>
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
<script type="text/javascript">
YUI ({
gallery: "gallery-2012.05.09-20-27"
}).use ("gallery-textarea-autoheight", function (Y) {
Y.one("textarea").plug (Y.TextareaAutoheight);
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1214990-4']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>