troubleshooting Question

Auto Expand textarea using javascript library

Avatar of ZekeLA
ZekeLAFlag for United States of America asked on
Web Languages and StandardsJavaScriptScripting Languages
10 Comments1 Solution1254 ViewsLast Modified:
I found this post on using jquery to auto expand a textarea as you add / delete text: http://james.padolsey.com/javascript/jquery-plugin-autoresize/. The online demo works for IE 7 but the test page I created doesn't work in IE 7. My test page doesn't resize.

Here is my test page:
<html lang="en">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <script src="jquery-1.4.min.js" type="text/javascript"></script>
   <script src="autoresize.jquery.min.js" type="text/javascript"></script>
   <script type="text/javascript">
     $(document).ready(function(){
       $('textarea').autoResize({
          // On resize:
          onResize : function() {
              $(this).css({opacity:0.8});
          },
          // After resize:
          animateCallback : function() {
              $(this).css({opacity:1});
          },
          // Quite slow animation:
          animateDuration : 100,
          // More extra space:
          extraSpace : 10
       });
     });
   </script>
 </head>
 <body>
   <a href="http://jquery.com/">jQuery</a>
   <br />
   <br />   
   <textarea id="myComments" style="width: 400px; padding: 10px; height: 50px; display: block; font-family:Sans-serif; font-size:1.2em;">
Type something in here, when you get close to the end the box will expand!
   </textarea>
 </body>
 </html>

The online demo uses jquery 1.3 but I tried that as well but it had no effect on my test page's problem.

Is there something I forgot to do on my test page?

I'd like to use a jquery auto-resize since we already have it in our project but I'm open to other libraries or solutions.

Thanks in advance
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros