jquery-plugin-orAutoheight.js (304B)
1 /** 2 * Input-Hints 3 */ 4 jQuery.fn.orAutoheight = function() 5 { 6 7 var resize = function( element ) 8 { 9 var lines = $(element).val().split("\n").length; 10 $(element).attr('rows',lines+3); 11 }; 12 13 $(this).each(function(i) 14 { 15 resize(this); 16 }); 17 18 return $(this).keypress(function() 19 { 20 resize(this); 21 }); 22 };