Skip to content

Instantly share code, notes, and snippets.

@behrangsa
Created July 3, 2011 09:11
Show Gist options
  • Save behrangsa/1062094 to your computer and use it in GitHub Desktop.
Save behrangsa/1062094 to your computer and use it in GitHub Desktop.
Fixed installAmination function
function installAnimation(inputElem, marginTopEnd, animationLength) {
$(inputElem).bind('input', function() {
var label = $(this).prev("label");
var labelMarginTop = label.css('margin-top');
label.stop();
if ($(this).val().length > 0) {
animateMarginTop(label, marginTopEnd, animationLength);
} else if ($(this).val().length == 0) {
animateMarginTop(label, "0px", animationLength);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment