【问题标题】:Double click instead of single click is required with custom button in IEIE中的自定义按钮需要双击而不是单击
【发布时间】:2013-07-23 05:06:11
【问题描述】:

请看以下链接:

http://jsfiddle.net/HAaFb/55/

不知道为什么这需要双击以及如何修改它以单击一次。 该问题仅发生在 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)?

标签: jquery css html


【解决方案1】:

我不会深入研究小提琴中的代码,因为我认为这与您的 html 中的代码不完全一样(例如打开 div)。

尝试删除border: 10000px solid transparent;

【讨论】:

  • 谢谢,这似乎是它现在完美运行的问题。即使在 IE 10 中 ;)
  • 谢谢!解决了我的问题!
猜你喜欢
  • 2015-11-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-31
  • 1970-01-01
相关资源
最近更新 更多