【发布时间】:2013-07-23 05:06:11
【问题描述】:
请看以下链接:
不知道为什么这需要双击以及如何修改它以单击一次。 该问题仅发生在 IE 中,它适用于 Mozilla。
HTML:
<div class="custom-input-file">
<input type="hidden" value="10000000" name="MAX_FILE_SIZE" />
<input class="input-file" type="file" size="1" onchange="readURL(this);" multiple="multiple" name="files[]" />
Choose files
</div>
CSS
.custom-input-file .input-file {
margin: 0;
padding: 0;
outline: 0;
font-size: 10000px;
border: 10000px solid transparent;
opacity: 0;
filter: alpha(opacity=0);
position: absolute;
right: -1000px;
top: -1000px;
cursor: pointer;
}
.custom-input-file {
overflow: hidden;
position: relative;
cursor: pointer;
}
.custom-input-file {
background-color:yellow;
width: 229px;
height: 29px;
font-family: "Tw Cen MT";
font-weight: bold;
font-size: 18px;
text-align: center;
padding-top: 7px;
margin: 0 auto;
color:black;
}
【问题讨论】:
-
它在 IE 9 中运行良好。只需单击一下。
-
我没有解决方案,但我确实在 IE10 中遇到了同样的问题。每次单击都不起作用,双击起作用。
-
感谢 MiniRagnarok 但根据海报“文件上传的文本部分发生双击”对我来说整个按钮都发生了,也没有提供明确的(代码)解决方案/解决方法在帖子中,所以我暂时将这个小提琴保持打开状态,因为我认为当/如果这个问题得到解决时,它通常会很有用。
-
@Athanatos fiddle 对你有用吗(我没有在这台机器上安装 IE10)?