Created
June 18, 2012 21:16
-
-
Save Shpigford/2950781 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$.fn.fauxPlaceholder = function(){ | |
return this.each(function(){ | |
$(this) | |
.click(function(){ | |
$(this).find("label").hide(); | |
$(this).find('input').focus(); | |
}).find("input").focus(function(){ | |
$(this).prev('label').hide(); | |
}).blur(function(){ | |
if (!$(this).val()){ | |
$(this).prev('label').show(); | |
} | |
}) | |
}); | |
} | |
$('.tracking_single_number p').fauxPlaceholder(); | |
$('.tracking_single_number p input').focus(function(){ | |
$(this).parents('form').addClass('selected'); | |
$(this).parents('form').children('.note').removeClass('hidden'); | |
if ($('.overlay').length <= 0){ | |
$('body').prepend('<div class="overlay"></div>'); | |
} | |
}); | |
$('.overlay').live(click_event,function(){ | |
$(this).remove(); | |
$('.tracking_single_number').removeClass('selected'); | |
$('.tracking_single_number').children('.note').addClass('hidden'); | |
$('#listing article header .actions').hide(); | |
$('#listing article header .current').show(); | |
}); | |
$('.tracking_single_number p input').keyup(function(event) { | |
if (event.keyCode == 13) { | |
this.form.submit(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment