手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >基于jquery的让textarea自适应高度的插件
基于jquery的让textarea自适应高度的插件
摘要:Introduction1.Thistextareaislikethegooglecalendar'sdescriptionwhenyouc...

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 id="textarea1"></textarea>

4. make it works

<script language="javascript" type="text/javascript">

$(document).ready(function () {

$(".autoHeight").TextAreaAutoHeight();

});

</script>

【基于jquery的让textarea自适应高度的插件】相关文章:

10条建议帮助你创建更好的jQuery插件

jquery实现图片左右切换的方法

Mozilla中显示textarea中选择的文字

jQuery判断指定id的对象是否存在的方法

jQuery实现自动滚动到页面顶端的方法

关于IFRAME 自适应高度的研究

jquery实现点击label的同时触发文本框点击事件的方法

textarea是否自动换行

jquery预加载图片的方法

手机端页面rem宽度自适应脚本

精品推荐
分类导航