Hoping to make this a fairly regular thing, I'll try and post little code bits and pieces every other weekend or so. Things like jQuery plugins, maybe some Kohana modules, maybe the odd CSS trick.
I've been pretty ill this weekend, but have fished out something from my personal stash you might like; a quick jQuery plugin that aims to replicate the HTML5 attribute "
placeholder".
Dead simple to use, simply include the script, change your input[type=text]'s and textareas to include the placeholder="" attribute and then do :
[javascript]$('input[type=text], textarea').placeholder();[/javascript]
In your document ready function ($(function())).
Want it? Head on over to GitHub to download:
Obviously you need jQuery to use this (1.3.x and 1.4.x are both fine), and the plugin supports every browser that jQuery itself does.
Wanna see it in action? Clicky clicky:
Enjoy! If you find this plugin useful feel free to comment. If you don't like it, well poo to you sir.