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

 更新时间:2010年08月03日 00:38:12   作者:  
jquery extension - auto height text area
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怎样实现ajax联动框(一)

    jquery怎样实现ajax联动框(一)

    ajax联动框想必大家早有所耳闻,接下来本文详细介绍下使用jquery实现的原理及代码,感兴趣的你可以参考下,或许对你有所帮助
    2013-03-03
  • jquery+easeing实现仿flash的载入动画

    jquery+easeing实现仿flash的载入动画

    本文主要给大家讲述的是如何使用jquery+easeing实现仿flash的载入动画的方法,附上示例代码,非常细致全面,这里推荐给大家,希望对大家熟练使用jQuery有所帮助。
    2015-03-03
  • Jquery无须浏览实现直接下载文件

    Jquery无须浏览实现直接下载文件

    这篇文章介绍了Jquery无须浏览实现直接下载文件的方法,文中通过示例代码介绍的非常详细。对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2022-05-05
  • JQueryiframe页面操作父页面中的元素与方法(实例讲解)

    JQueryiframe页面操作父页面中的元素与方法(实例讲解)

    这篇文章主要是对JQueryiframe页面操作父页面中的元素与方法进行了详细的分析介绍,需要的朋友可以过来参考下,希望对大家有所帮助
    2013-11-11
  • jquery $.each()使用探讨

    jquery $.each()使用探讨

    想必大家对jquery $.each()并不陌生吧,使用它可以进行元素的遍历,下面有个不错的示例,感兴趣的朋友可以参考下
    2013-09-09
  • jQuery实现碎片轮播效果

    jQuery实现碎片轮播效果

    这篇文章主要为大家详细介绍了jQuery实现碎片轮播效果,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2022-05-05
  • jQuery获取table表中的td标签(实例讲解)

    jQuery获取table表中的td标签(实例讲解)

    下面小编就为大家带来一篇jQuery获取table表中的td标签(实例讲解)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-07-07
  • 初步认识JavaScript函数库jQuery

    初步认识JavaScript函数库jQuery

    这篇文章主要介绍了JavaScript函数库jQuery的一些基本概念,包括其的添加方法和最基本的使用示例,需要的朋友可以参考下
    2015-06-06
  • 使用jQuery.wechat构建微信WEB应用

    使用jQuery.wechat构建微信WEB应用

    本期要讲的就是我痛苦中挣扎徘徊后写的jQuery.wechat,一个提供了统一API的、基于jQuery.promise的jQuery.plugin。希望能多少帮助到大家。
    2014-10-10
  • 可自己添加html的伪弹出框实现代码

    可自己添加html的伪弹出框实现代码

    本文为大家介绍下html伪弹出框的实现,感兴趣的朋友可以了解下
    2013-09-09

最新评论