使用远程源禁用在 IFRAME 内双击

Disabling double click inside the IFRAME with remote source

本文关键字:双击 IFRAME 程源禁      更新时间:2023-09-26

伙计们,

我们有一个奇怪的要求,我们想在 IFRAME 内禁用双击。

这里的复杂之处在于 HTML 响应来自远程 URL,我们无法控制它。是否可以在此 IFRAME 中禁用双击。

例如

Iframe src="http://removeserver/view.jsp" 高度="300px"

width="300px">

注意:我们已经调查过,似乎由于交叉脚本,我们无法做到这一点。基本上,我们无法访问页面远程服务器/视图的HTML元素.jsp因为它来自远程网站。

任何帮助将不胜感激。

iframe 上方的空div 将禁用对 iframe 内容的任何鼠标操作http://jsfiddle.net/uxUF8/63/

<iframe with="300" height="300" src="https://www.youtube.com/embed/OsOYg5gpS0s" ></iframe>
<div style="position:absolute;margin-top:-300px;width:300px;height:300px;border:1px solid red;" ></div>

另一个版本允许您在 http://jsfiddle.net/uxUF8/62/内滚动