返回列表

background设成transparent时,IE10及以下会点击穿透

默认分类 2014/11/04 22:07

background设成transparent时,IE10及以下会点击穿透

Bug: http://haiyang.me/demo/bgurl.html
Fix: http://haiyang.me/demo/bgurl_fix.html

之前我都是用一张1px的透明背景图片来修复这个问题,@钟玲 建议用#代替透明图片,赞~

<div style="background-image:url(#); position:absolute;z-index;99999; border:1px solid green; width:300px;height:200px;">This is cover layer.<br/>Click here won't through.</div>
<br/>
<button onclick="alert('click-events-passing-through')" style="padding-left: 150px;">I am below the cover.</button>