• Prev
  • Stop
  • Play
  • Next
  • Aquarium
  • Fine Day
  • Bright Green Lights
  • For Your Smile
  • Pull You Through
  • In Your System
  • ♻ retweet this page
  • contact me
  • subscribe
  • follow me on twitter
    • 2010-04-29T12:17 woop! virtualbox 3.2b1 has experimental support for os x guests. http://bit.ly/aBymre
    • 2010-04-29T10:12 @mathie ouch!
    • 2010-04-29T10:11 @hoyd made a quick test app once, that's about it. would be interested in doing more, however.
    • 2010-04-29T09:17 think i've found my new job http://bit.ly/bce0x5
    • 2010-04-29T08:36 back from a nice 4 hour trip to A&E. just in time to start work :/
  • elsewhere
    • github github
    • linkedin linkedin
    • delicious delicious
    • flickr flickr
    • email email

  • Home
  • Logfile
  • Work With Me
  • Open Sawrce
  • Labs
  • About
  • Sitemap
14.09.2008

Two Quick jQuery plugins before bedtime

Just a couple of extractions from recent projects that may be useful to somebodies.

First up is an automatically growing textarea. This implementation is borrowed from Facebook and uses an off-screen auxiliary <div> to calculate the required dimensions of the textarea. Usage is simple:

Autogrowing textarea example:
  1. $('textarea').autogrow();

Next is a cookie-based style switcher, the obvious use of which is toggling between small/medium/large text. Quite why the browser supplied zoom features are insufficient is a mystery to me, but hey ho, the client is always right.

Cookie-based style switcher example:
  1. cookieResize('#sizer a', 'medium');

The first argument is a selector matching the resize/style-switching links. When the user clicks any of these its CSS class will be applied to document.body - this class name will also be stored in a cookie for retrieval on successive page views. The second argument is the default class to use if no cookie is present.

No official plugin pages for these; just copy and paste into your project…

Linkage: auto-growing textarea | cookie-based style switcher

Archives

  • December 2009 (2)
  • May 2009 (1)
  • March 2009 (1)
  • January 2009 (1)
  • October 2008 (1)
  • September 2008 (2)
  • August 2008 (2)
  • June 2008 (2)

Friends

  • Magic Lamp
  • Garage Duo
  • Atom
  • Drew not Weird
  • Enthusiastik
  • Fusible Front
  • Jam Hot
  • John Disco
onehackoranother.com © 2008 - 2010 Jason Frame. All rights reserved.