Created
December 5, 2016 16:26
-
-
Save lcdsantos/d09e172f81fab313761d4282ad0786c9 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
/*! Custom Input File v1.0 - Copyright (c) 2016 Leonardo Santos */ | |
(function($) { | |
$.fn.inputFile = function() { | |
return this.each(function() { | |
var $this = $(this); | |
$this | |
.on('change', function() { | |
var value = /[^(\\|\/)]*$/.exec($this.val()); | |
$this.siblings('span').text(value[0]); | |
}) | |
.on('mouseenter mouseleave', function() { | |
$this.parent().toggleClass('hover'); | |
}); | |
}) | |
} | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment