Fancybox 2在iframe的facebook页面加载页面 [英] Fancybox 2 in iframe of facebook page with a page load

查看:93
本文介绍了Fancybox 2在iframe的facebook页面加载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用fancybox 2在Facebook页面中设置一个应用程序,其中一个页面作为iframe加载到fancybox中。它工作正常,除了在IE(谁会知道!)。

I'm trying to make an application in a facebook page with the use of fancybox 2 where a page is loaded as an iframe in the fancybox. It works all fine, except in IE (who would've known!).

在我的fancybox 2有一个按钮,提交一个表单,并发送给另一个页面。此页面加载在与上一页相同的fancybox窗口中。当加载此页面时,fancybox的高度未正确调整,因此我的一半页面不可见。

In my fancybox 2 there is a button that submits a form and sends you to another page. this page is loaded in the same fancybox window as the previous page. When this page is loaded, the height of the fancybox is not adjusted properly, so half of my page is not visible.

我现在要做的是更改fancybox iframe的高度,但是我已经停止了获取iframe的实际大小。

What I'm trying to do now is change the height of the fancybox iframe, but I'm already stuck on getting the actual size of the iframe.

这里我加载的最后一页的javascript代码fancybox iframe:

here my javascript code in the last page that is loaded in the fancybox iframe:

$(document).ready(function() {
    var inner = $('.fancybox-inner');
    console.log(inner);
});

这个console.log给我'null',这告诉我这个类不存在于页。
我也尝试了以下内容:

This console.log gives me 'null' back, which tells me this class does not exist in the page. I have also tried the following:

parent.$('.fancybox-inner');
parent.$('.fancybox-iframe');
$('.fancybox-iframe');
$.fancybox;
parent.fancybox;

我的fancybox加载:

my fancybox load:

$(document).ready(function() {
$(".uploadbox").fancybox({
    scrolling : 'no',
    preload   : true,
    type      : 'iframe',
    width     : '623px',
    height    : 'auto',
    autoSize  : true,
    afterLoad : function () { $.fancybox.update(); }, //this does not work
    closeBtn  : false,
        closeClick  : false,
        helpers     : { 
            overlay : {closeClick: false}
        }
    });
});

任何帮助将不胜感激!

推荐答案

我从来没有设法解决这个问题。我会向你解释为什么:

I have never managed to solve this issue. I'll explain to you why:

Facebook页面使用iframe将您的网站显示在他们的网站上。要在fancybox 2中显示另一个页面,您还需要使用iframe。因为iframe中的iframe总是给出问题(跨浏览器等等),所以没有办法给父窗口提供我的fancybox的高度,因为双重iframe。由于应用程序不得不上线,我决定给它一个静态的高度。将来我不会再使用Fancybox 2,或者任何一件事情,这只是Facebook内的一大难题。

Facebook pages use an iframe to show your website into their website. To show another page into fancybox 2 you need to use an iframe too. Because an iframe in an iframe is always giving problems (cross browser and so on), there was no way to give the parent window the height of my fancybox, because of the double iframe. Since the app had to go live, I decided to give it a static height. In the future I will not use Fancybox 2 anymore or any of that matter, it's just one big misery inside Facebook.

这篇关于Fancybox 2在iframe的facebook页面加载页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆