Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Ajax Jquery No Max-height Fixed

Related Tutorials


 
 

Share on Google+Share on Google+

No Max-height Fixed

Advertisement
In this JQuery tutorial we will develop a program that Auto generate of a Textarea with minimum fixed height but no max height fixed.

No Max-height Fixed

     

In this JQuery tutorial we will develop a program that Auto generate of a Textarea with minimum fixed height but no max height fixed.

Steps to develop the Auto generate of a Textarea  with minimum fixed height but no max height fixed .

Step 1:

 

 

 

Create a new file (autoGrowText.html) and add the following code into it:

 

<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">

<title>Tabs</title>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="script/jquery.autogrow.js"></script>

<script type="text/javascript">
$(document).ready (function() {

$('textarea.expandText').autogrow();

});
</script>
<style type="text/css">

textarea.expandText {
line-height: 10px;
}

</style>
</head>
<body>

TextArea Min-Height 100Px
<textarea style="width: 300px; min-height: 100px;" class="expandText" name="myTextarea">
</textarea>

</body>
</html>

Program explanation:

The following code includes the jQuery JavaScript library file:

<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript" src="script/jquery.autogrow.js"></script>

The Code

$('textarea.expandText').autogrow();

 This function works auto generate the textarea of id "expandText" 

and having correponding style css.

textarea.expandText {
line-height: 10px;
}

This increase the height 10px per line and Minimum height 100px  

Output :

Min Height : 100 px

No Max- Height 

Output :

 

Check online demo of the application

Learn from experts! Attend jQuery Training classes.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 8, 2008

Related Tutorials

Discuss: No Max-height Fixed  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com