Very Simple Input Overlay

2009-07-19

I have been growing increasingly dissatisfied with the solution for overlay texts on input controls I have been using, so I decided to come up with a new system which would be easier to implement and maintain. I found this article by Sam Dunn but I found it somewhat unpolished so I worked on it a bit to make it smoother to use. Include the following script in your page: http://static.eldmyra.se/input_overlay/input_overlay.js (and the stylesheet http://static.eldmyra.se/input_overlay/input_overlay.css for some basic styling) and set an attribute ”default_value” on the input control with the value you want to display as overlay:

<input name=”foo” default_value=”overlay” type=”text”/>

And that’s pretty much it. If you update the document with new input control via javascript you will need to call updateInputOverlays() to update them though.

– Möller

Annonser

Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut / Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut / Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut / Ändra )

Google+ photo

Du kommenterar med ditt Google+-konto. Logga ut / Ändra )

Ansluter till %s

%d bloggare gillar detta: