Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//add placeholder for subscribe form
$(".widget_ns_mailchimp input").focus(function(){
showEmptyLabels();
$(this).siblings("label").stop().fadeOut();
});
$(".widget_ns_mailchimp input").blur(function(){
showEmptyLabels();
});
$(".widget_ns_mailchimp label").bind("click", function() {
$(this).siblings("div").find("input, textarea").focus();
});
function showEmptyLabels() {
$(".widget_ns_mailchimp input").each(function(){
if( $(this).val() == "") {
$(this).siblings("label").fadeIn();
}
});
}
.widget_ns_mailchimp label {
position: absolute;
margin-top: 8px;
margin-left: 10px;
display: inline;
opacity: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.