Created
November 23, 2011 01:38
-
-
Save mduvall/1387683 to your computer and use it in GitHub Desktop.
test fade input like squareup.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<style type="text/css"> | |
input#email { z-index:1; height:27px; } | |
label[for='email_label'] { z-index:0; position:absolute; } | |
</style> | |
<script type="text/javascript"> | |
$("input").live({ | |
focus: function() { | |
$(this).keypress(function() { | |
$("label[for='" + this.id + "_label']").fadeOut(); | |
})} | |
}); | |
</script> | |
</head> | |
<label for="email_label"> | |
Email address | |
</label> | |
<input class="xlarge" id="email" type="text"> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment