Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 467095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:32:47+00:00 2026-05-12T23:32:47+00:00

I was playing around with the jquery autogrow plugin, which expands the height of

  • 0

I was playing around with the jquery autogrow plugin, which expands the height of the text automatically as the text needs it. The problem is that with every key down, the bottom border of the textarea jitters in a noticeable way. I’m not sure what the problem could be, so I’m going to go out on a limb and post the 132 lines of this GPL plugin here. Any hints where the problem could be or how to circumvent it?

         /* 

      Auto Expanding Text Area (1.2.2)  by Chrys Bader */

        (function(jQuery) {
           var self = null;     
           jQuery.fn.autogrow = function(o){
             return this.each(function() {  
                new jQuery.autogrow(this, o);
             });
           };


      /**
      * The autogrow object.
      *
      * @constructor
      * @name jQuery.autogrow
      * @param Object e The textarea to create the autogrow for.
      * @param Hash o A set of key/value pairs to set as configuration properties.
      * @cat Plugins/autogrow
      */        

     jQuery.autogrow = function (e, o) {
        this.options = o || {};         
        this.dummy = null;
        this.interval = null;
        this.line_height = this.options.lineHeight || parseInt(jQuery(e).css('line-height'));
        this.min_height = this.options.minHeight || parseInt(jQuery(e).css('min-height'));
        this.max_height = this.options.maxHeight || parseInt(jQuery(e).css('max-height'));;
        this.textarea = jQuery(e);

       if(this.line_height == NaN) this.line_height = 0;

       // Only one textarea activated at a time, the one being used
       this.init();     
    };  

    jQuery.autogrow.fn = jQuery.autogrow.prototype = { autogrow: '1.2.2' };
    jQuery.autogrow.fn.extend = jQuery.autogrow.extend = jQuery.extend;
    jQuery.autogrow.fn.extend({ init: function(){
       var self = this;
       this.textarea.css({overflow: 'hidden', display: 'block'});
       this.textarea.bind('focus', function(){ self.startExpand() }).bind('blur', function() { self.stopExpand() });
       this.checkExpand();
    },

    startExpand: function() { 
        var self = this;
        this.interval = window.setInterval(function() { self.checkExpand()}, 400); },
    stopExpand: function() { clearInterval(this.interval); },
    checkExpand: function() { 
       if (this.dummy == null) {
          this.dummy = jQuery('<div></div>');
          this.dummy.css({
             'font-size'  : this.textarea.css('font-size'),
             'font-family': this.textarea.css('font-family'),
             'width'      : this.textarea.css('width'),
             'padding'    : this.textarea.css('padding'),
             'line-height': this.line_height + 'px',
             'overflow-x' : 'hidden',
             'position'   : 'absolute',
             'top'        : 0,
             'left'    : -9999
          }).appendTo('body');
      }
// Strip HTML tags          
var html = this.textarea.val().replace(/(<|>)/g,'');
// IE is different, as per usual            
if ($.browser.msie){
    html = html.replace(/\n/g, '<BR>new');
} else {
    html = html.replace(/\n/g, '<br>new');
}

if (this.dummy.html() != html){
   this.dummy.html(html);

if (this.max_height > 0 && (this.dummy.height() + this.line_height > this.max_height)){
    this.textarea.css('overflow-y', 'auto');
} else { 
    this.textarea.css('overflow-y', 'hidden');
    if (this.textarea.height() < this.dummy.height() + this.line_height || (this.dummy.height() < this.textarea.height())) {
    this.textarea.animate({height: (this.dummy.height() + this.line_height) + 'px'}, 100); 
}
}
} 
}
}); 
})(jQuery);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:32:47+00:00Added an answer on May 12, 2026 at 11:32 pm

    In regard to jeerose’s comment:

    http://www.aclevercookie.com/aclevercookiecom-breached-problem-resolved/

    It has been brought to my attention by
    visitors that their virus protection
    goes off when they come to this blog.
    I investigated the matter and found
    that harmful code had been injected
    into the source of the site.

    This has been resolved and measures
    have been taken to increase the
    security of the site.

    Thanks for the report, and I apologize
    for the alarm.

    Which doesn’t seem to be true. As my antivirus still fires when opening that site

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm playing around with writing a jQuery plugin that uses an attribute to define
I'm playing around with the <canvas> element, drawing lines and such. I've noticed that
Just playing around with the now released Silverlight 2.0. I'm trying to put a
While playing around with regexps in Scala I wrote something like this: scala> val
I'm currently playing around with HTML_QuickForm for generating forms in PHP. It seems kind
I'm playing around with LinqToSQL using an existing multi-lingual database, but I'm running into
I'm playing around with a native (non-web) single-player game I'm writing, and it occured
Hallo i am currently playing around with castle projects ActiveRecord and the remoting facility.
I was playing around with my own Sudoku solver and was looking for some
I am playing around with MVC and have started setting up an existing site

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.