Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 放大iFrame';内容_Jquery_Html_Flash_Zooming - Fatal编程技术网

Jquery 放大iFrame';内容

Jquery 放大iFrame';内容,jquery,html,flash,zooming,Jquery,Html,Flash,Zooming,我试图放大(而不是改变大小)iFrame,其中源是SWF文件 <iframe src="http://ray.eltania.net/TEST/swf-play/swf/testMotion.swf" width="600px" height="500px" frameBorder="0"></iframe> 如果Iframe来自不同的域,则不能。这将是一种跨站点脚本攻击,它将被浏览器阻止。我创建了一个类似这样的解决方法 HTML <iframe class="z

我试图放大(而不是改变大小)iFrame,其中源是SWF文件

<iframe src="http://ray.eltania.net/TEST/swf-play/swf/testMotion.swf" width="600px" height="500px" frameBorder="0"></iframe>

如果Iframe来自不同的域,则不能。这将是一种跨站点脚本攻击,它将被浏览器阻止。

我创建了一个类似这样的解决方法

HTML

<iframe class="zoom" src="http://something"></iframe> <!-- add class zoom to iframe -->

因此,让我们假设有一个10000x1000px大小的SWF文件,但只使用中心的100x100px。那我被巨大的白色区域困住了吗?是的。你不能操纵别人网站上的iframe内容。那太可惜了。如果在加载后将jQuery代码注入iFrame会怎么样?比如$(“iframe”).next(“嵌入”).css(“宽度”、“150%”)?你愿意尝试。相同来源的政策将阻止它。只想注意,作为对新(ish)用户的鼓励,添加
-webkit transform:scale(2)
作为Safari和Chrome的一个修复程序,由。
<iframe class="zoom" src="http://something"></iframe> <!-- add class zoom to iframe -->
iframe {
  width: 400px;
  height: 400px;
  border: 0;
}
.zoom {
  -webkit-transform: scale(2); /* Safari and Chrome */ 
  transform: scale(2); /* zoom factor - prefix if needed */
  width: 200px; /* half of iframe width */
  height: 200px; /* half of iframe height */
  margin: 100px 0 0 100px; /* reposition iframe */
  overflow: hidden; /* remove big-ass scrollbars */
}