Skip to content

Instantly share code, notes, and snippets.

@hkdobrev
Created February 6, 2012 20:22
Show Gist options
  • Save hkdobrev/1754579 to your computer and use it in GitHub Desktop.
Save hkdobrev/1754579 to your computer and use it in GitHub Desktop.
Hidden File Input jQuery Plugin
$.fn.hiddenFileInput = function () {
$.each(this.filter('input[type=file]'), function () {
var input = $(this),
parent = input.parent();
input.css({
opacity: 0,
width: parent.css('width'),
height: parent.css('height'),
position: 'absolute',
left: 0,
top: 0
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment