Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.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
如何在长iFrame中打开视口中心的灯箱_Iframe_Viewport_Lightbox2 - Fatal编程技术网

如何在长iFrame中打开视口中心的灯箱

如何在长iFrame中打开视口中心的灯箱,iframe,viewport,lightbox2,Iframe,Viewport,Lightbox2,我的整个站点有一个索引页面,其中加载了iFrame。 我有一个很长的iFrame中的图片缩略图,当使用lightbox显示缩略图的较大图像时,lightbox会在iFrame的最顶部打开 我在父窗口中已经有一个脚本,可以根据iFrame中加载的页面长度来调整iFrame的高度,我从来没有通过脚本调用父窗口来打开父窗口中的lightbox,我猜这是由于已经存在的脚本: <script> function resizeIframe(obj) { { obj.style.

我的整个站点有一个索引页面,其中加载了iFrame。 我有一个很长的iFrame中的图片缩略图,当使用lightbox显示缩略图的较大图像时,lightbox会在iFrame的最顶部打开

我在父窗口中已经有一个脚本,可以根据iFrame中加载的页面长度来调整iFrame的高度,我从来没有通过脚本调用父窗口来打开父窗口中的lightbox,我猜这是由于已经存在的脚本:

<script>
function resizeIframe(obj) {
       {   obj.style.height = 0; };
        { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';}
  }</script>

功能调整框架(obj){
{obj.style.height=0;};
{obj.style.height=obj.contentWindow.document.body.scrollHeight+'px';}
}
以及iframe链接上的onload

<iframe src="discog.html" name="iframeContenu" width="100%" height="100%" 
scrolling="no"  frameborder="0" id="iframeContenu" 
onload="javascript:resizeIframe(this);"></iframe>

是否可以在视口级别(即单击缩略图的位置)而不是在iframe的顶部显示lightbox图像