基于jquery的讓textarea自適應(yīng)高度的插件
更新時間: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>
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>
相關(guān)文章
jquery怎樣實現(xiàn)ajax聯(lián)動框(一)
ajax聯(lián)動框想必大家早有所耳聞,接下來本文詳細介紹下使用jquery實現(xiàn)的原理及代碼,感興趣的你可以參考下,或許對你有所幫助2013-03-03
jquery+easeing實現(xiàn)仿flash的載入動畫
本文主要給大家講述的是如何使用jquery+easeing實現(xiàn)仿flash的載入動畫的方法,附上示例代碼,非常細致全面,這里推薦給大家,希望對大家熟練使用jQuery有所幫助。2015-03-03
JQueryiframe頁面操作父頁面中的元素與方法(實例講解)
這篇文章主要是對JQueryiframe頁面操作父頁面中的元素與方法進行了詳細的分析介紹,需要的朋友可以過來參考下,希望對大家有所幫助2013-11-11
jQuery獲取table表中的td標(biāo)簽(實例講解)
下面小編就為大家?guī)硪黄猨Query獲取table表中的td標(biāo)簽(實例講解)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-07-07
初步認(rèn)識JavaScript函數(shù)庫jQuery
這篇文章主要介紹了JavaScript函數(shù)庫jQuery的一些基本概念,包括其的添加方法和最基本的使用示例,需要的朋友可以參考下2015-06-06
使用jQuery.wechat構(gòu)建微信WEB應(yīng)用
本期要講的就是我痛苦中掙扎徘徊后寫的jQuery.wechat,一個提供了統(tǒng)一API的、基于jQuery.promise的jQuery.plugin。希望能多少幫助到大家。2014-10-10

