Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Facebook does it, when you write on people's walls, but only resizes vertically.</p> <p>Horizontal resize strikes me as being a mess, due to word-wrap, long lines, and so on, but vertical resize seems to be pretty safe and nice.</p> <p>None of the Facebook-using-newbies I know have ever mentioned anything about it or been confused. I'd use this as anecdotal evidence to say 'go ahead, implement it'.</p> <p>Some JavaScript code to do it, using <a href="http://en.wikipedia.org/wiki/Prototype_JavaScript_Framework" rel="noreferrer">Prototype</a> (because that's what I'm familiar with):</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;script language="javascript"&gt; google.load('prototype', '1.6.0.2'); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;textarea id="text-area" rows="1" cols="50"&gt;&lt;/textarea&gt; &lt;script type="text/javascript" language="javascript"&gt; resizeIt = function() { var str = $('text-area').value; var cols = $('text-area').cols; var linecount = 0; $A(str.split("\n")).each( function(l) { linecount += Math.ceil( l.length / cols ); // Take into account long lines }) $('text-area').rows = linecount + 1; }; // You could attach to keyUp, etc. if keydown doesn't work Event.observe('text-area', 'keydown', resizeIt ); resizeIt(); //Initial on load &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>PS: Obviously this JavaScript code is very naive and not well tested, and you probably don't want to use it on textboxes with novels in them, but you get the general idea.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload