Click on Overlay . Simulating Click using Jquery

2019-05-11 20:52发布

问题:

I am overlaying hidden rectangle on my iframe. Then Detecting click inside my rectangular region. Then i will take its (X,Y) and simulate a click inside iframe on same coordinate(X,Y).

This way, i will pass user's click on hidden rectangular area to iframe as it is not possible to directly detect events on iframe because of security issues.

This will bypass that issue.

Some problem with my code. Not able to pass click to iframe on triggering.

Here is Js Fiddle

http://jsfiddle.net/biggenius/Y8cVD/9/

Here is a way to click inside box. http://jsfiddle.net/styson/PxcBs/1/

How to detect click on Overlay?http://jsfiddle.net/biggenius/Y8cVD/13/

Here are some solution worth considering. http://stackoverflow.com/questions/10226448/detecting-click-inside-iframe-using-invisible-div/10226475#comment13139245_10226475

http://i.stack.imgur.com/fQiJT.png

回答1:

You mean like this? There were a couple of missing brackets/slight syntax errors in your fiddle :)

Demo: http://jsfiddle.net/Y8cVD/14/