• Home
  • Blog
  • Lifestream
  • Me
  • Twitter

Recent Posts

  • » Google Car - Damn I'm Observant
  • » Travelling - What's Next?
  • » Posh East Perth Apartment
  • » House in Perth
  • » House Sitting in Adelaide
  • » Sailing The Whitsundays
  • » Agnes Water / 1770
  • » Fraser Island
  • » Coomera Springs and Noosa
  • » Byron Bay

Tags

  • 365  australia  code  experiences  explore  flickr  france  function  holiday  house  javascript  misc  movie  perth  photo  photography  photos  php  random  rant  review  ski  skiing  thailand  traveling  travelling  trekking  video  work 

Search


Links

  • » 365 Gallery
  • » Twitter
  • » Lifestream
  • » My Flickr

Archives

  • » January 2010 (1)
  • » November 2009 (2)
  • » August 2009 (2)
  • » June 2009 (2)
  • » May 2009 (5)
  • » April 2009 (6)
  • » March 2009 (4)
  • » February 2009 (1)
  • » January 2009 (2)
  • » December 2008 (3)
  • » November 2008 (2)
  • » October 2008 (2)
  • » September 2008 (5)
  • » August 2008 (3)
  • » July 2008 (1)
  • » June 2008 (2)
  • » April 2008 (10)
  • » March 2008 (7)
  • » February 2008 (5)
  • » January 2008 (9)
  • » December 2007 (2)

 RSS Feed

Search results for 'expanding'

Javascript expanding textareas

April 12th, 2008
Hey ho,

All over the web i'm seeing sites such as facebook with textareas that vertically expand automagically (and from what I hear FF3 has this functionality built in) but until everyone starts using Firefox i'v written a handy javascript function that will simulate the effect in other browsers.

The problem with all the others examples i've seen round the net are that they all require you to use some sort of CSS bodgery or require jQuery or Prototype. With my lil sript theres no need for any of that nonsense and you can basically throw anything you like at it... or use your own styles in a stylesheet or inline.

I've tried to make it as easy as possible, all you need to do is add "autoExpand" to the textareas class and my script will do its magic, it can also works with ajax calls by calling autoExpand(object) after your ajax call returns.

The javascript file is available below and there is a DEMO you can have a looksy at.

It's been tested on IE7, FF2, Safari 3 and Opera 9 and works more or less as intended, it doesn't work on IE6 at the moment, but when i get access to IE6 i'll be sure to fix it :-)

Download: autoexpand.js

Love you!
No Comments »
.
 
Twitter   |   Contact “everything should be made as simple as possible, but no simpler ” - Albert Einstein