Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
JQuery Super Labels Plugin (github.com/remybach)
31 points by remybach on May 14, 2012 | hide | past | favorite | 16 comments


It's cute but too much distracting IMO. I prefer to have it fade a little bit on focus and disappear on writing.


There's an option to do that:

$('form').superLabels({ slide:false });


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


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.


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).


No. Placeholders stay visible until user starts typing. That is, empty focused field still has visible placeholder.


Only in Chrome. Not in Firefox, at least.


True! It wasn't like this when I wrote the plugin though, plus I needed the effect to work cross-browser.


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.


Should probably use stop() before animating or else there's a funny effect if I click the fields back and forth really fast.


Hmmm... not quite a real-world scenario though. I like to consider it a quirky easter-egg :)


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 :)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: