最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jquery - Javascript click through element - Stack Overflow

programmeradmin2浏览0评论

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. Is there a way to click on specific coordinates with JS, or maybe determine underlying element having absolute x and y positions? Thanks.

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. Is there a way to click on specific coordinates with JS, or maybe determine underlying element having absolute x and y positions? Thanks.

Share Improve this question asked Jul 16, 2010 at 20:55 Dmitry GladkovDmitry Gladkov 1,3652 gold badges12 silver badges24 bronze badges 2
  • 4 check out this answer to find the element by coordinates, and then trigger onclick on the found element: stackoverflow./questions/590119/… – Nick Commented Jul 16, 2010 at 21:01
  • would it be possible when the div element is added, you build a connection of the div element to the element above it. Then when the element above it is clicked, a handler is invoked for the div? – Paul Commented Jul 16, 2010 at 21:07
Add a ment  | 

2 Answers 2

Reset to default 4

Nick has posted a link to awesome answer on how to get elements by x and y but unfortunately it's a ment so I can't accept it. :(

If you can find out what is the element given the coordinates, you can always trigger the onclick handler yourself with jQuery using the .click() function.

发布评论

评论列表(0)

  1. 暂无评论