https://cdn.statically.io/gh/dte-project/a/1e23173799f8ac7c346f345f20de4e5ccb246b1e/shell.v2.min.css
Loading...

Minggu, 16 Juni 2013

JQuery

$('[placeholder]').each(function() {
var plc = $(this).attr('placeholder');
$(this).addClass('blur').removeAttr('placeholder').val(plc).on("focus blur", function(e) {
// Add a `blur` class to fade the text color for the default placeholder text
$(this)[(e.type == "blur" && (this.value === "" || this.value == plc)) ? "addClass" : "removeClass"]('blur');
// Set the value to `plc` on blur if the element value is empty
if (e.type == "blur" && this.value === "") $(this).val(plc);
// Set the value to empty on focus if the element value is same with the default placeholder text
if (e.type == "focus" && this.value == plc) $(this).val("");
});
});

CSS

input.blur,
textarea.blur {color:#bbb}

View more articles

Keyword link

Subscribe via Email

Sign up by email to get the latest news from us..

Contact us

Send a message to us.

Template Hasil Cloning II | Copyright 2015 - 2016 | Rip Code by Shn | ShannenPio Cloning