history
resizable text areas
by anders pearson
Fri 01 Apr 2005 11:28:57
i did "this":http://thraxil.org/test/resize.html about a year ago but forgot to really mention it to anyone. now, there seems to be a renewed interest in all things javascript/dhtml, so maybe someone will find it useful. it's basically just a little javascript hack that makes it so users can dynamically resize a textarea on a page. it works in every modern browser i've tried it in and degrades gracefully to a plain old textarea in any browser that doesn't support it or has javascript disabled.
i'm trying to make a point of sharing more of these little tricks with the world.
the script uses a drag and drop implementation from "elsewhere":http://www.walterzorn.com/dragdrop/dragdrop_e.htm. i'm not crazy about it, but i wasn't about to write my own. at some point though, i'd like to remove the little bit of javascript in the page that it requires to make it more in line with the idea of "unobtrusive javascript":http://www.onlinetools.org/articles/unobtrusivejavascript/. that will probably require modifying the drag + drop library though, or implementing the parts of it that i need on my own.
i'm also really interested in taking this technique and turning it into a "greasemonkey":http://greasemonkey.mozdev.org/ script so i can resize the textareas on any page on the web.
comments
Mike P - Wed 06 Apr 2005 12:44:36
As far as that last bit goes, check this out: http://www.stilleye.com/expandArea.user.jsanders - Wed 06 Apr 2005 13:48:12
very cool. i may tweak it a bit to make it reflow the page when the textareas are resized. as is, just the textarea is expanded and other inputs on the page can end up overlapping it so it doesn't really work on some pages.l0b0 - Thu 07 Apr 2005 09:24:36
Very nice, but it's got one fairly dangerous bug: If the textarea is resized to zero height, only the single top pixel row of the button can be used to resize the textarea. The equivalent goes for the width.Anonymous - Wed 20 Apr 2005 14:28:03
doesn't work in IE 6Andrew - Wed 11 May 2005 10:29:02
This seems like a nice thing to have as a Greasemonkey script, but it's probably not stable or obvious enough to use in public.Matthias - Fri 03 Jun 2005 07:54:00
It's true, it doesn't work in IE. I fiddled a bit with your example and found out that for some reason (I didn't analyse walter zorn's script) you have to put the script include tag inside the body tag to make it work in IE. I guess making it unobtrusive will be a bit of work.