jQuery.Phile Demo
Make file inputs styleable and more friendly for css
Usage
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src='dist/jquery.phile.min.js'></script>
$("input[type='file']").phile();
.phile {
...
}
.phile .text {
...
}
.phile .button {
...
}
Structure
The basic structure of the project is given in the following way:
βββ demo/
β βββ index.html
βββ dist/
β βββ jquery.phile.js
β βββ jquery.phile.min.js
βββ src/
β βββ jquery.phile.js
βββ .gitignore
βββ .jshintrc
βββ Gulpfile.js
βββ README.md
βββ package.json
Options
wrapClass [default: "phile"]
Root wrapper class name. $("input").phile({ wrapClass: "customWrapClass" })
textClass [default: "text"]
Class name for fallback input text element. $("input").phile({ textClass: "customTextClass" })
buttonClass [default: "button"]
Class name for button. $("input").phile({ buttonClass: "customButtonClass" })
buttonText [default: "Browse"]
Custom text for button. $("input").phile({ buttonText: "chooseFile" })
placeholder [default: ""]
Custom placeholder for input text fallback: $("input").phile({ placeholder: "Choose file..." })
Also, you can specify the [placeholder] attribute for input[file] it will be used as default values automatically. <input type="file" placeholder="Choose file...">
reversed [default: false]
Swap order of text and button. $("input").phile({ reversed: true })
History
Check Releases for detailed changelog.
License
MIT License Β© Zeno Rocha