Autowidthjs

Gem Version

Automatically adjusts the width of the object input to the width of the content. DEMO: http://jsbin.com/ahaxe

Installation

Add this line to your application's Gemfile:

gem 'autowidthjs'

And then execute:

$ bundle

Or install it yourself as:

$ gem install autowidthjs

Usage

Add to your application.js:

//= require jquery.autowidth

And to your *.js:

$('input#yourinput').autoGrowInput({
    comfortZone: 50,    // Zone after text in input
    minWidth: 200,          // Minimal input width
    maxWidth: 2000          // Maximal input width
});

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request