DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> jQuery入門知識 >> JQuery特效代碼 >> 基於jquery的讓textarea自適應高度的插件
基於jquery的讓textarea自適應高度的插件
編輯:JQuery特效代碼     
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>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved