Internet explorer 8 event fall through transparent parents

坚强是说给别人听的谎言 提交于 2019-12-11 02:37:45

问题


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.

I solved it by setting the background color to non trasnparent and using

-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";

to achieve transparency instead of the old

-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#66C6DEA2,endColorstr=#66C6DEA2)";

Thanks to everyone that helped!


回答1:


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)



来源:https://stackoverflow.com/questions/4416922/internet-explorer-8-event-fall-through-transparent-parents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!