It worked for me; it iterates over all the textarea elements on the Ready page and sets their height.
$(function () { $("textarea").each(function () { this.style.height = (this.scrollHeight+10)+'px'; }); });
You can also combine it with an auto-expansion feature to make it fully dynamic when recording:
function autoresize(textarea) { textarea.style.height = '0px';
and call this from the "keyup" event or through jQuery:
$('.autosize').keyup(function () { autoresize(this); });
Notice how I add 10px to the scroll height: here you can adjust the amount of space in which you want the bottom of the text area to be displayed to the user.
Hope this helps someone. :)
Edit: Modified answer according to @Mariannes comment.
Tormod Haugene Aug 05 '13 at 7:35 am
source share