我只是想知道为什么在文件输入功能起作用之前我必须单击并选择两次。当我第一次选择时,直到我第二次选择它才会选择。
<div class="3u 12u$(small)">
<button name="buttonupload" id="buttonupload" class="special">
<i class="fa fa-cloud-upload fa-2x" aria-hidden="true"></i>
Upload Logo
</button>
<input id="file-upload" style="visibility:hidden;" type="file">
</div>
<div class="3u 12u$(small)">
<span id="filename" style="font-family: "></span>
</div>
$(function () {
$('#buttonupload').click(function () {
$('#file-upload').trigger('click');
$('#filename').text($('#file-upload:file').val());
});
});