基于jquery的让textarea自适应高度的插件

2019-12-24,,,,

Introduction
1. This textarea is like the google calendar's description when you create one new or update one existence calendar;
2. Its height will be changed accroding to user's input;
3. Its scrollbar is removed, which makes it much user friendly. I guess you may like it.

Using the code

1. 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>

2. 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>

3. add one textare html control
<textarea class="autoHeight" id="textarea1"></textarea>

4. make it works
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$(".autoHeight").TextAreaAutoHeight();
});
</script>

您可能感兴趣的文章:

  • jquery 动态调整textarea高度
  • jquery 多行文本框(textarea)高度变化
  • jquery 插件实现多行文本框[textarea]自动高度
  • jquery实现textarea 高度自适应
  • Jquery实现textarea根据文本内容自适应高度
  • jquery实现文本框textarea自适应高度

《基于jquery的让textarea自适应高度的插件.doc》

下载本文的Word格式文档,以方便收藏与打印。