Created
June 11, 2013 10:19
-
-
Save clare485/5755849 to your computer and use it in GitHub Desktop.
placeholder in input for mailchimp widget
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
//add placeholder for subscribe form | |
$(".mc_input").focus(function(){ | |
showEmptyLabels(); | |
$(this).siblings("label").stop().fadeOut(); | |
}); | |
$(".mc_input").blur(function(){ | |
showEmptyLabels(); | |
}); | |
$(".mc_merge_var label").bind("click", function() { | |
$(this).siblings("div").find("input, textarea").focus(); | |
}); | |
function showEmptyLabels() { | |
$(".mc_input").each(function(){ | |
if( $(this).val() == "") { | |
$(this).siblings("label").fadeIn(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice Gist - Have forked with CSS