Text Area Resizer - A Prototype Port

Sam Burney | Fri, 11/14/2008 - 04:57

For whatever reason, when I first delved into JavaScript and AJAX a few years ago I picked Prototype as my helper library.

Since then I've written a lot of code requiring Prototype, so even though the idea of switching to something like jQuery has been tempting, the fact that I would either have to rewrite a whole bunch of code or include TWO 100kB+ JavaScript libraries has kept me away.

One of my main on-going projects required a resizable text area, and I knew that Drupal (This blog is a Drupal site) had just the right thing for it.  The problem is that Drupal's TextAreaResizer script is written for jQuery and it seemed rather stupid to include the whole of jQuery just to put a 'grippie' on the bottom of a textarea.  No other Prototype ports of this exist (At least that I could find) so I decided to give doing it myself a go.

Prototype Port of textarearesizer.js

Features:

  • Simple, neat and unobtrusive textarea and iframe resizing
  • Written for use with Prototype
  • Tested in Firefox 3.0.3 and Internet Explorer 7
  • Ability to specify a callback function after you have finished dragging

Links:

Updates:

  • Chrome fix: Thanks to Scott Falkingham