互联网浏览器8事件通过透明的父母落下 [英] Internet explorer 8 event fall through transparent parents
问题描述
当你有一个透明的div,你生成一个点击(例如),点击直到下面的元素。这种行为在其他现代浏览器中并不存在,我相信这是W3C的任何建议。最后,它弄乱了我的设计。有没有办法解决这个问题?
When you have a transparent div and you generate a click on in (for example) the click falls right through to elemets below. This behavior does not exists in other modern browsers and I am sure is out of any W3C recommendation. Finally, it messes up my design. Is there any way to work around this?
澄清 - 透明,没有背景颜色定义或背景颜色:透明;
Clarification - transparent like with no background color defined or with background-color: transparent;
另一个澄清 - 我的意思是,浏览器的行为是透明元素完全不存在 - 忽略其事件处理程序,并触发下面不是他父母的元素的其他事件处理程序,应该是隐藏它。
Another clarification - what I mean by falls right through is that the browser behaves as the transparent element is completely not there - ignores its event handlers and triggers other event handlers of elements below that are not his parents and should be hidden by it.
我通过将背景颜色设置为非trasnparent并使用
I solved it by setting the background color to non trasnparent and using
-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity = 40);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
而不是旧的
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#66C6DEA2,endColorstr=#66C6DEA2)";
感谢大家帮助!
推荐答案
可以通过给元素提供背景颜色和零或接近零的不透明度来修复吗?
当您要给文件输入元素提供自定义外观时使用此黑客( http: //www.quirksmode.org/dom/inputfile.html )
Can it we fixed by giving the element a background color and a zero or nearly zero opacity ? This hack is used when you want to give the file input elements a custom appearance (http://www.quirksmode.org/dom/inputfile.html)
这篇关于互联网浏览器8事件通过透明的父母落下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!