基于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>
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怎樣實現(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

