Floating Field Labels Floatify - Download Floating Form Field Labels With jQuery And CSS3 - Floatify

Download Floating Form Field Labels With jQuery And CSS3 – Floatify

Posted on

This time I will share jQuery Plugin and tutorial about Floating Form Field Labels With jQuery And CSS3 – Floatify, hope it will help you in programming stack.

Floating Field Labels Floatify - Download Floating Form Field Labels With jQuery And CSS3 - Floatify
File Size: 18.5 KB
Views Total: 1604
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Floatify is a super tiny jQuery plugin that makes the placeholders displayed as floating labels on the top of the text fields while typing.

Supports both textarea and input field. The plugin uses CSS3 to animate the floating input labels with a fade-in effect.

Inspired by Matt D. Smith’s Float Label Form Interaction.

How to use it:

1. Load the JavaScript jquery.floatify.js and Stylesheet jquery.floatify.css in the document which has jQuery library loaded.

1 <link rel="stylesheet" href="/dist/jquery.floatify.css">
3         integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
4         crossorigin="anonymous">
5 </script>
6 <script src="/dist/jquery.floatify.js"></script>

2. Add placeholders to your text fields.

1 <input type="text" placeholder="First name">
2  
3 <input type="text" placeholder="Last name">
4  
5 <input type="text" value="23" placeholder="Age">
6  
7 <textarea placeholder="Message"></textarea>
8  
9 ...

3. Attach the plugin to the text fields. Done.

1 $(function(){
2  
3   $('input, textarea').floatify();
4  
5 });

4. Set the position of the floating labels. Default: left.

1 $(function(){
2  
3   $('input, textarea').floatify({
4     position: 'right'
5   });
6  
7 });

5. Set the margin-left (position: left) or margin-right (position: right) of the floating labels.

1 $(function(){
2  
3   $('input, textarea').floatify({
4     hGap: 20 // default: 10px
5   });
6  
7 });

Changelog:

2018-10-08

  • v0.0.2

2018-09-17

  • v0.0.1

 


This awesome jQuery plugin is developed by digitalify. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net