Skip to content

A lightweight jQuery plugin allowing complete CSS styling of <input type="file"> elements. It degrades gracefully, and works (as near as I can tell) in all browsers other than IE6, which I didn't bother to test, because I don't support it.

License

Notifications You must be signed in to change notification settings

sgreenfield/inputFile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fileStyle is a lightweight (1.51KB) jQuery plugin allowing complete CSS styling of <input type=“file”> elements.

Overview

I created this plugin because it is impossible to achieve uniform cross-browser styling of the <input type=“file”> using only CSS. In fact, Firefox 4.0 and lower doesn’t even allow you to set the width in pixels.

The one plugin I was able to find that did something similar to this one, required a fixed width, an image for the “Browse…” button, and it had far too many cross-browser bugs.

This plugin solves those problems and more. Please create an issue for any bugs discovered, or email me at [email protected]

Usage Examples

$(document).ready(function(){

    $('.input-file-example-one').inputFile(); //gray button by default

    $('.input-file-example-two').inputFile({
        btnClass: 'btn-blue'
    });

});

Copyright © 2011 Scott Greenfield. See LICENSE for details.

About

A lightweight jQuery plugin allowing complete CSS styling of <input type="file"> elements. It degrades gracefully, and works (as near as I can tell) in all browsers other than IE6, which I didn't bother to test, because I don't support it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published