【发布时间】:2014-10-30 17:36:56
【问题描述】:
如果我使用 css 属性 display: none 隐藏它,Safari 就不会打开元素!但它适用于所有其他浏览器。
这是我的html:
<div id="f" class="btn">Select Image</div>
<input type="file" id="file" style="display:none;" name='athletes_imageid' value="" />
现在在我的 jquery 中,我想通过单击“选择图像”<div> 打开id="file":
$("#f").click(function() {
$("#file").click();
});
【问题讨论】:
-
#f有身高吗?试着给它一些高度 -
在
div#f上使用style="height:10px"属性 -
@VivekKumarBansal 这不能解决问题,我可以在 Safari 中使用
visibility: hidden但不能使用display: none
标签: javascript jquery html css safari