Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 919 Bytes

README.markdown

File metadata and controls

42 lines (30 loc) · 919 Bytes

#jquery.inputfit.js Plugin that makes value of the input fit into the input, see the demo

Requires

  • jquery 1.4.4 or higher

Default options

minSize : 12
maxSize : 24

Using:

<input type="text" name="younameit" id="input">
<script type="text/javascript">
    $('input').inputfit();
</script>

Plugin fits text by changing the font-size, so you should set min and max font-size values. Oh, and it relies on id of the element. It doesn't have to be called by id, but it should have it anyway.

Note

I just needed this functionality for our company's project, it works alright with some potential tweaking in all browsers (IE6+, CHR, SAF, FF3+, O10+ etc.). Please, file an issue if something is broken, I promise I'll look in to it)

TODO:

  • refactor "id" dependency
  • fix jumps in some cases
  • fix all hardcode :(