Git Product home page Git Product logo

floatlabel.js's Introduction

FloatLabel.js

A jQuery plugin for floating form labels.

Based on a UI concept by Matt D. Smith.

FloatLabel.js demo.

Usage

Add jquery.FloatLabel.css to your websites stylesheets and jquery.FloatLabel.js to your scripts.

  • Add jquery.FloatLabel.js to your scripts. Example -
<script src="scripts/jquery.js"></script>
<script src="scripts/jquery.FloatLabel.js"></script>
<script src="scripts/main.js"></script>
  • Add jquery.FloatLabel.css to your stylesheets. Example -
<link rel="stylesheet" href="styles/normalize.css">
<link rel="stylesheet" href="styles/jquery.FloatLabel.css">
<link rel="stylesheet" href="styles/main.css">
  • Wrap the fields you wish to effect with your chosen class. Example -
<div class="js-float-label-wrapper">
    <label for="name">Name</label>
    <input id="name" type="text">
</div>
  • Initialise FloatLabel.js, passing the plugin your input/label wrapper class. Example -
$( '.js-float-label-wrapper' ).FloatLabel();

Customisation

As FloatLabel.js works by using CSS classes, the animations can be tweeked within jquery.FloatLabel.css.

If the default classes conflict with the rest of your CSS for whatever reason, you can change them by passing in paramaters when you initialise the plugin. Don't forget to update jquery.FloatLabel.css with your new class names if you need to make a change.

$( '.js-float-label-wrapper' ).FloatLabel({
    populatedClass : 'custom-populated-class',
	focusedClass : 'custom-focused-class'
});

floatlabel.js's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.