JQuery Super Labels Plugin(github.com)
github.com
JQuery Super Labels Plugin
https://github.com/remybach/jQuery.superLabels
This plugin positions your labels on top of your form fields (similiar visually to placeholder) and makes the label slide across the field when gaining focus and fade out when a value is entered.
17 comments
Seems OTT to me,
I generally use normal boring labels, then modernizer to detect if the browser supports placeholders, if so hide the labels and add placeholders to the attributes
I generally use normal boring labels, then modernizer to detect if the browser supports placeholders, if so hide the labels and add placeholders to the attributes
That's not what placeholders are meant to be used for though (see here: http://www.whatwg.org/specs/web-apps/current-work/multipage/...).
This plugin doesn't replace (true) placeholder functionality, so I suppose it's the same as what you're doing except more semantic.
This plugin doesn't replace (true) placeholder functionality, so I suppose it's the same as what you're doing except more semantic.
Oh, also... once you're in the field, the placeholder disappears and you have no idea what you were meant to type (which is why the plugin slides to the side by default).
FWIW, Safari and Chrome both keep placeholder text there like this plug-in does (without the animation). It'd be nice to get FireFox on board.
Yes, in -webkit- browsers you can achieve the same effect with this CSS:
&::-webkit-input-placeholder {
-webkit-transition: text-indent 200ms ease-in-out;
visibility: visible !important;
}
&:focus::-webkit-input-placeholder {
text-indent: 115px; /* Change to width of input */
}
If only you could do the same for Firefox...I had looked into doing this with pure CSS, but I hit a roadblock. I can't remember what it was, but it may have been the Firefox thing mentioned. Would be cool to add a css file that does the same to the project when the support is there though.
how do you get the labels back again? sometimes my browser or password manager fills in the wrong fields, and, once there's something in the fields, there's no labels.
Yeah, I've got an issue open on github for this. I'll fix it when I get the chance. Thanks :)