There may be an elegant way to unleash / rebuild resilient events, but for quick brute force enumeration, you can use an important attribute to redefine CSS at the height of the textarea.
Create a text field with the rows attribute (so that we know what size the text field returns):
<textarea rows="4"></textarea>
Attach focus / blur functions to the text field to override / reset height:
jQuery(function() { $('textarea').focus(function() { // remove any height overrides $(this).css('height', ''); // make it elastic $('textarea').elastic(); }); $('textarea').blur(function() { // override the height on the textarea to force it back to its original height $(this).css('height', $(this).attr("rows") + 'em !important'); }); });
source share