开发者

How to make an element transparent to clicks but still visible?

开发者 https://www.devze.com 2023-03-12 01:21 出处:网络
I\'m interested in putting an inset box shadow on something like an iframe. While the strategy of overlaying a div over the iframe gives the expected visual d开发者_Python百科isplay, the div subsequen

I'm interested in putting an inset box shadow on something like an iframe. While the strategy of overlaying a div over the iframe gives the expected visual d开发者_Python百科isplay, the div subsequently blocks clicks on the iframe itself.

Sample: http://jsfiddle.net/YqXPg/

So is there a way to pull off the inset shadow as a "framing" effect?


Yes, there's pointer-events: none.

See: http://jsfiddle.net/YqXPg/3/

A version that makes the overlay more obvious: http://jsfiddle.net/YqXPg/4/

Note that this property doesn't work with IE, but if I remember correctly, IE will allow you to click through the transparent parts of the overlay div anyway.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号