Browsers do not let you style file
inputs. File Style plugin fixes this
problem. It enables you to use image
as browse button. You can also style
filename field as normal textfield
using css. It is written using
JavaScript and jQuery.
某些浏览器需要文件输入可见并手动单击浏览按钮,否则它将不会向服务器提交任何内容。所以我建议 Saefraz 的第一个解决方案:File Style Plugin for jQuery
some browsers need File input visible and click the browse button manually, or it will submit nothing to server. so i suggest Saefraz's first solution: File Style Plugin for jQuery
发布评论
评论(5)
CSS 方式(基本代码位于此处):
The CSS way (base code found here):
没有简单的跨浏览器方法来设置文件输入类型的样式。因此存在甚至使用 javascript 的解决方案。
这是一个 jQuery 插件,您可以使用它以跨浏览器的方式设置文件类型的样式:
您可以在此处查看演示
正如流行的 ajaxian.com 上发布的那样,您也可以看看这个:
There is no easy cross-browser way to style the input type of files. Therefore there exist solution that even use javascript.
Here is a jQuery plugin you can use to style file types in the cross-browser fashion:
You can check out the demo here
As also posted on popular ajaxian.com, you can take a look at this too:
我编写了这个 jQuery 插件,以便更简单地设置文件输入的样式。使用 CSS 和“假元素”来获得您想要的结果。
http://github.com/jstnjns/jquery-file
希望有帮助!
I wrote this jQuery plugin to make it much simpler to style the file input. Use CSS and "fake elements" to get the results you want.
http://github.com/jstnjns/jquery-file
Hope that helps!
某些浏览器需要文件输入可见并手动单击浏览按钮,否则它将不会向服务器提交任何内容。所以我建议 Saefraz 的第一个解决方案:File Style Plugin for jQuery
some browsers need File input visible and click the browse button manually, or it will submit nothing to server. so i suggest Saefraz's first solution: File Style Plugin for jQuery