7 ms·
JQuery Super Labels Plugin
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.
- egze 14y agoShould probably use stop() before animating or else there's a funny effect if I click the fields back and forth really fast.
- remybach 14y agoHmmm... not quite a real-world scenario though. I like to consider it a quirky easter-egg :)
- david_a_r_kemp 14y agohow 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.
- remybach 14y agoYeah, I've got an issue open on github for this. I'll fix it when I get the chance. Thanks :)
- phzbOx 14y agoIt's cute but too much distracting IMO. I prefer to have it fade a little bit on focus and disappear on writing.
- remybach 14y agoThere's an option to do that: $('form').superLabels({ slide:false });
- 5h 14y agoSeems 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
- remybach 14y agoThat's not what placeholders are meant to be used for though (see here: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#the-placeholder-attribute 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.
- remybach 14y agoOh, 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).
- flixic 14y agoNo. Placeholders stay visible until user starts typing. That is, empty focused field still has visible placeholder.
- jonknee 14y agoFWIW, 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.
- Keithamus 14y agoYes, 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...
- btucker 14y agohttps://developer.mozilla.org/en/CSS/:-moz-placeholder https://developer.mozilla.org/en/CSS/:-moz-placeholder
- remybach 14y agoI 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.
- lenkite 14y agoJust use HTML5 placeholder. All that 'sexiness' reduces usability.