点击Overlay。使用Jquery模拟点击 [英] Click on Overlay . Simulating Click using Jquery
问题描述
我在我的iframe上覆盖隐藏的矩形。然后检测我的矩形区域内的点击。然后,我将采用其(X,Y)并在同一坐标(X,Y)上模拟iframe内的点击。
这样,我将通过用户点击隐藏因为安全问题无法直接检测iframe上的事件。
这将绕过该问题。
我的代码存在一些问题。
这里是Js Fiddle
http://jsfiddle.net/biggenius/Y8cVD/9/
这是一种方法点击框内。 h ttp://jsfiddle.net/styson/PxcBs/1/
如何检测Overlay上的点击? http://jsfiddle.net/biggenius/Y8cVD/13/
以下是一些值得考虑的解决方案。 http://stackoverflow.com/questions/10226448/detecting-click-inside-iframe-using-invisible-div/10226475#comment13139245_10226475
http://i.stack.imgur.com/fQiJT.png
你的意思是这样吗?在你的小提琴中有几个丢失的括号/轻微的语法错误:)
演示: http://jsfiddle.net/Y8cVD/14/
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
You mean like this? There were a couple of missing brackets/slight syntax errors in your fiddle :)
Demo: http://jsfiddle.net/Y8cVD/14/
这篇关于点击Overlay。使用Jquery模拟点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!