Jquery extension-auto height text area

Source: Internet
Author: User

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>

 

 

 

Demo
Please click here to view details

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.