Input expand is a jQuery plug-in for creating an expanded text box that automatically expands to the right when it is focused or clicked.
auto expand input width based on text length, input width auto resize css, textarea grow with content
Onclick Stylish Expanding Search Box in HTML CSS Code
How to make use of it:
1. Load the latest version of the jQuery library and jQuery Extensible Input Plugin into your document.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="jquery.expandable.js"></script>
2. Create an input field on your web page.
<input id="search" type="text" placeholder="Type something here..."></input>
3. Call the plugin in the search input you just created and set the target view you want to expand to.
$("#search").expandable({ width: 500, });
4. Options and assumptions.
$("#search").expandable({ // width, extended to width: 150, // duration of the animation duration: 300, // function triggered when you press enter. // receive input's value as a parameter. action: function(val){ alert(val); } });
jQuery Plugin To Create Smooth Animated Text Fields, expandable-input Plugin/Github
See Demo And Download
Official Website(nnattawat): Click Here
This superior jQuery/javascript plugin is developed by nnattawat. For extra Advanced Usages, please go to the official website.