jquery - IE 中的自定义按钮需要双击而不是单击

标签 jquery css html

请查看以下链接:

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

不确定为什么这需要双击以及如何将其修改为只需单击即可工作。 该问题仅在与 Mozilla 配合使用的 IE 中发生。

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;
}

最佳答案

我不会深入讨论 fiddle 中的代码,因为我认为这与您在 html 上的内容不完全相同(例如打开的 div)。

尝试移除 border: 10000px solid transparent;

关于jquery - IE 中的自定义按钮需要双击而不是单击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17796698/

相关文章:

javascript - 如何在客户端浏览器中检测特定版本的 webkit?

javascript apply() 函数、jQuery 和 'this' 指针

javascript - window.location.hash向下滚动不平滑只能向左滚动

javascript - 带滚动的响应式导航 DIV

javascript - 如何在 Windows 网络中的我的 Intranet Web 应用程序中获取用户的用户名

html - zoom css 属性不适用于 firefox

html - 在matToolTip(Angular)中渲染HTML内容

javascript - Leaflet map 需要刷新页面才能在 Jquery Mobile 应用程序中显示

javascript - Roweditor 中的 Ext JS 复选框

css - 为什么我不能在 HTML 页面的中心添加任何段落?