简体   繁体   English

JavaScript点击后元素

[英]Javascript click through element

There is a semitransparent overlay div covering document which destroys on click, but I need somehow to trigger onlick events of the element beneath overlay at the same time. 有一个半透明的覆盖div覆盖文档,该文档在单击时会破坏,但是我需要某种方式同时触发覆盖下的元素的onlick事件。 Is there a way to click on specific coordinates with JS, or maybe determine underlying element having absolute x and y positions? 是否可以通过JS单击特定坐标,或者确定具有绝对x和y位置的基础元素? Thanks. 谢谢。

Nick has posted a link to awesome answer on how to get elements by x and y but unfortunately it's a comment so I can't accept it. 尼克已经发布了一个很棒的答案的链接 ,该答案关于如何通过x和y获取元素,但是不幸的是,这是一条评论,所以我不能接受。 :( :(

如果可以找到给定坐标的元素,则始终可以使用.click()函数使用jQuery自己触发onclick处理程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM