隐藏div文件上传按钮单击

时间:2015-07-17 14:20:44

标签: jquery file-upload

我需要一个

的功能

默认显示图片

使用{input type="file"}上传文件时隐藏的图片

http://jsfiddle.net/vVsAn/1/

<div id='browse-img-sh'><img src="https://cdn4.iconfinder.com/data/icons/Pretty_office_icon_part_2/64/man.png" /></div>    
<input name="" type="file">

1 个答案:

答案 0 :(得分:0)

jQuery(document).ready(function(){
    jQuery('#hideshow').live('click', function(event) {        

        if (window.File && window.FileReader && window.FileList && window.Blob)
        {
            if (jQuery('#file_input')[0].files[0] != undefined) {
                jQuery('#content').toggle('show');
            }
        }
        else {
            console.log("File API is not supported");
        }
    });
});

我认为这可以帮助你。