Created
February 28, 2012 17:54
-
-
Save rezen/1933981 to your computer and use it in GitHub Desktop.
JS: input[type=File upload mask input[type="file"]!
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
// File upload mask | |
$('.upload-masked').each(function(){ | |
var $this = $(this) | |
, $mask = $('<input type="text" class="upload-mask" value="" />'); | |
$this.wrap('<div class="input-wrap" style="position:relative;"></div>'); | |
$this.css({opacity:0,position:'absolute'}); | |
$this.after('<span class="upload-mask-button">BROWSE</span>'); | |
$this.after($mask); | |
$this.change(function(){ | |
var val = this.value; | |
$mask.val(val); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment