使元素不可单击(单击其后面的内容) [英] Make element unclickable (click things behind it)

查看:83
本文介绍了使元素不可单击(单击其后面的内容)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个固定的图像,当用户正在滚动触摸屏(移动)时,该图像会覆盖页面。

I have a fixed image that overlays a page when the user is in the act of scrolling a touch screen (mobile).

我想制作该图像 unclickable或 inactive或其他任何方式,因此,如果用户触摸并从该图像上拖动,它后面的页面仍会滚动,就好像该图像不在其中阻塞了交互。

I want to make that image "unclickable" or "inactive" or whatever, so that if a user touches and drags from that image, the page behind it still scrolls as if the image weren't there "blocking" the interaction.

这可能吗?

谢谢!

推荐答案

设置CSS-指针事件:无应该删除任何鼠标与图像的交互。除了IE以外,其他所有语言都支持得很好。

Setting CSS - pointer-events: none should remove any mouse interaction with the image. Supported pretty well in all but IE.

这里是值指针事件可以接受的完整列表

Here's a full list of values pointer-events can take.

这篇关于使元素不可单击(单击其后面的内容)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆