如何通过元素传递点击? [英] How can I pass a click through an element?

查看:88
本文介绍了如何通过元素传递点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当鼠标事件发生时,我想在鼠标下显示一个图像(手指模拟触摸屏),并在mouseup事件发生时隐藏它,但是当我这样做时,我显示的图像会阻止后续的鼠标事件(特别是点击)在此图像下的元素。我正在使用jQuery。

I want to display an image under the mouse (a finger to simulate a touch screen) when a mousedown event occurs and hide it when the mouseup event occurs, but when I do this, the image I display blocks the subsequent mouse events ("click" in particular) on elements under this image. I'm using jQuery, by the way.

我确信这是与事件冒泡或传播有关的事情,但我无法理解。任何指针都可以吗?

I'm sure this is something to do with event bubbling or propagating or somewhat, but I couldn't figure it out. Any pointers please?

推荐答案

在这篇文章中查看这个答案:

Check out this answer to on this post:

https://stackoverflow.com/a/4839672/589909

好像我明白你想用纯粹的跨浏览器CSS方法实现什么。

It seems to do what I understand what you want to achieve using a pure cross browser CSS approach.

指针事件:无;

这篇关于如何通过元素传递点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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