Skip to content

Instantly share code, notes, and snippets.

Created August 2, 2013 01:36
Show Gist options
  • Save anonymous/6136869 to your computer and use it in GitHub Desktop.
Save anonymous/6136869 to your computer and use it in GitHub Desktop.
Hint JS
/*DISPLAY HINTS FOR INPUTS*/
$("input").live("focus",function(){
var hint = $(this).attr("hint");
if(hint!==undefined && $(this).attr('hint')!= "oms.localized.hint."+$(this).attr('name')){
$(this).after("<div class='hint'>"+hint+"</div>");
$(".hint").fadeIn("fast");
$(this).closest(".row").find("label.error").hide();
}
})
$("input").live("blur",function(){
$(this).closest(".row").find(".hint").fadeOut('fast',function(){
$(this).remove();
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment