Introduction
- This textarea is like the google calendar's description when you create one new or update one existence calendar;
- Its height will be changed accroding to user's input;
- Its scrollbar is removed, which makes it much user friendly. I guess you may like it.
Using the code
-
import the jquery.js and textarea.js
<script language="javascript" type="text/javascript" src="js/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="js/textarea.js"></script> -
add the following css
<style type="text/css">
.autoHeight{border:1px solid #666666; width:300px; height:60px; line-height:20px; font:11px verdana; overflow:hidden;}
</style> -
add one textare html control
<textarea class="autoHeight" id="textarea1"></textarea> -
make it works
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$(".autoHeight").TextAreaAutoHeight();
});
</script>