Click on Overlay . Simulating Click using Jquery

风流意气都作罢 提交于 2019-12-22 10:21:57

问题


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/



来源:https://stackoverflow.com/questions/10241873/click-on-overlay-simulating-click-using-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!