jquery - 透明覆盖 div 允许在 IE 7,8 中点击

标签 jquery css internet-explorer-8 internet-explorer-7 overlay

我有一个包含表单元素的 div,我正在使用一个不可见的覆盖掩码,它应该覆盖我的容器。但是没有背景的 IE 7 和 8(错误地)允许点击槽。

我找到的解决方案是在不透明度为 0.1 的叠加 div 上使用背景色。这是部分工作,但在我的例子中,容器元素是可排序的元素,当我开始排序时,表单元素表现得很奇怪(只有当我在 jquery 可排序上使用不透明度选项时)

示例标记:

<div class="sort">
    <div class="cont">
        <div class="mask"></div>
        <label for="test">Test</label>
        <input type="text" value="Some" name="test" id="test" />
    </div>
    <div class="cont">
        <div class="mask"></div>
        <label for="test">Test</label>
        <select value="Some" name="test2" id="test2">
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
        </select>
    </div>
</div>

CSS:

.cont {
    width: 300px;
    position: relative;
    background-color: #aaa;
    padding: 10px;
    margin: 10px;
}
.mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0.1;
    filter: alpha(opacity=0.1);
}

Javascript:

$(function() {
    $('.sort').sortable({opacity:0.8});
});

住在 http://jsfiddle.net/CmU59/4/

还有其他解决方法建议吗?

最佳答案

尽管我不明白您为什么要叠加您的 from 元素,您是否考虑过使用完全透明的 1x1px PNG 作为叠加背景?

关于jquery - 透明覆盖 div 允许在 IE 7,8 中点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6871132/

相关文章:

css - 如何动态居中图像(网站横幅)

css - 从 fontsquirrel 站点生成的 webfonts,如何更改目录?

javascript - ui-grid 的高度问题

javascript - 在不使用 <body onload> 的情况下将目标 ="_blank"附加到 iframe 中的链接

javascript - 选中自定义单选按钮时更改另一个 div 中 anchor 标记的颜色

jquery - 表中的 BlockUI - 不工作

java - IE/Facebook 问题 : Why Facebook Like box not display in Internet Explorer 6 - IE8?

windows - IE6 和 IE7 独立版 : What do they render differently?

html - Internet Explorer 中的隐藏文本

javascript - 获取超链接的 ALT 属性的属性值