Dmitry Gladkov
Dmitry Gladkov

Reputation: 1365

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

Upvotes: 5

Views: 3542

Answers (2)

Dmitry Gladkov
Dmitry Gladkov

Reputation: 1365

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. :(

Upvotes: 4

Francisco Soto
Francisco Soto

Reputation: 10392

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.

Upvotes: 1

Related Questions