Skip to content

jacware/fancyplaceholder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fancyplaceholder: a jQuery plugin

fancyplaceholder allows text box placeholders to be retained after there is text in the field. This is done by dropping the placeholder into a label below the field.

See a live demo.

Usage

Apply fancyplaceholder to the fields that you want it active on.

This will apply it to all the fields on a page that have a placeholder:

  $(':input[placeholder]').fancyplaceholder();

If you want to retain the labels even after the field loses focus call it like this:

  $(':input[placeholder]').fancyplaceholder({keepLabels:true});

You can also customize the built in CSS to change the look of the placeholder label.

Browser support

Natively placeholders are only supported in Firefox 4+, Chrome 2+, Safari 3+, and IE 10+. To use placeholders in older browsers you must use a plugin to enable the legacy support.

There are many of these, we recommend: https://github.com/mathiasbynens/jquery-placeholder

You can chain the two plugins together to use both:

$(':input[placeholder]').placeholder().fancyplaceholder();

Licensing

Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2013 Aaron Cosentino

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published