Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 551
Dmitry Gladkov Avatar asked Jul 16 '10 20:07

Dmitry Gladkov


2 Answers

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

like image 186
Dmitry Gladkov Avatar answered Sep 22 '22 02:09

Dmitry Gladkov


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.

like image 42
Francisco Soto Avatar answered Sep 21 '22 02:09

Francisco Soto