使元素不可点击(点击它后面的东西) [英] Make element unclickable (click things behind it)

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

问题描述

当用户滚动触摸屏(移动设备)时,我有一个固定的图像覆盖在页面上.

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

我想让该图像不可点击"或非活动"或其他什么,这样如果用户触摸并从该图像拖动,其后面的页面仍然滚动,就好像图像不存在阻止"交互一样.

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.

这可能吗?如果需要,我可以尝试提供屏幕截图来说明我的意思.

Is this possible? If need be, I could try to provide screen shots exemplifying what I mean.

谢谢!

推荐答案

设置 CSS - pointer-events: none 应该删除鼠标与图像的任何交互.除 IE 外,其他所有版本均支持良好.

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

这是一个完整的值列表pointer-事件可以采取.

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

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