GithubHelp home page GithubHelp logo

peachananr / label_better Goto Github PK

View Code? Open in Web Editor NEW
517.0 517.0 104.0 18 KB

Label your form input like a boss with beautiful animation and without taking up space

Home Page: http://peachananr.github.io/label_better/demo/demo.html

JavaScript 100.00%

label_better's People

Contributors

peachananr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

label_better's Issues

Opera keeps adding lb_label elements

Opera (v12.16, OS X Mavericks) doesn't seem to be removing the added "lb_label" elements. The hover state is also not triggered correctly (could be a CSS bug).

Attachment 1: Floating label is above cursor, but not above the field
Attachment 2: Ever-stacking DOM elements

screen shot 2014-01-21 at 14 31 31
screen shot 2014-01-21 at 14 31 44

EDIT--------
looking into this .. currently looks like the oTransitionEnd isn't fired. Read here that it got renamed to "otransitionend", but that isn't working either.

EDIT 2-----
Got stuck at the point where it looks like the translate3D css isn't set.
Logging the .attr('style) for the element after the switch/case went through, got me different results:

Chrome: "opacity: 1; left: auto; right: auto; position: absolute; -webkit-transition: all 250ms cubic-bezier(0.175, 0.885, 0.42, 1.31); transition: all 250ms cubic-bezier(0.175, 0.885, 0.42, 1.31); top: 0px; -webkit-transform: translate3d(0, -24px, 0);"

VS

Opera: "left: auto; right: auto; position: absolute; top: 0px; opacity: 1;"

EDIT 3-----
Fixed the issue by changing the transition on translate3D to the good ol' "top".
And if you're interested, I got this working in IE8-9 by adding the placeholder as :before content in browsers marked as old (with conditional comments).

Enhancing accessibility with label-elements

The behaviour and animation of this solution is nice. However I am missing the use of actual label-elements. Pairing label- and input-elements is considered best practice for forms. Is there any reason for not using labels in the markup of the demo?

No Label with Chrome Autocomplete

When any input is autocompleted by Chrome on page load (i.e. login credentials), the label doesn't show up. The only way to get the label to show is to completely clear the input.

Form reset does not clear bounced text

I input something in a text and a label is shown on top of the text box. When I press Reset button (form reset) to clear the text box, the content is reset but the label still remains on top of the text box but also shows inside. Please instruct how to clear out the bounced text while doing form reset.

Thanks :)

IE and textareas : in the middle of the box

Hello!
First great plugin, it runs really smooth.

I just have one problem with IE and a textarea. For all my inputs, default position is "top" and the new placeholder goes where it should. But for my textarea, the new placeholder appears in the middle of the area.

I attached a screenshot to give a better idea.
screenshot

Everything is ok with the other browsers.

And here is my code. Everything should be default for label_better
<textarea class="label_better orange" data-position="top" rows="8" name="histoire" data-new-placeholder="Ta meilleure histoire" placeholder="bla bla"></textarea>
Thank you!

Textarea & Fade

Hi there! Great piece of code! Thank you for sharing.

I have two quick questions.

  1. How can I apply this to a "textarea" input to a form? Tried several things and couldn't get it to work.
  2. The fade on animation happens for the label. How can the same be accomplished on the original placeholder?

Cheers,
Thomas

Validation

Hey, the plugin is awesome, but what about with validation of this forms?

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.