FB.ui 和设置弹出窗口大小

2022-01-20 00:00:00 size popup javascript facebook

我正在使用 FB.ui 并将显示参数设置为弹出.

I am using FB.ui with the display parameter set to popup.

当方法是stream.publish"时,它会在加载内容时自动调整大小.但是,当使用fbml.dialog"(为了显示多朋友选择器)时,它会显示我无法更改的大小(并且显示的内容会被裁剪).

When the method is 'stream.publish', it autoresizes when the content is loaded. However, when using 'fbml.dialog' (in order to display a multi-friend selector) it shows a size that I'm not able to change (and the content is displayed cropped).

我尝试了以下方法,但没有成功:

I have tried with the following approaches, with no luck:

FB.ui({
method: 'fbml.dialog',
size: {width: 800, height: 500},
...

FB.ui({
method: 'fbml.dialog',
width: 800,
height: 500,
...

我也一直在查看 API 源代码,它以这种方式声明方法:

Also I've been looking at the API source code, and it declares the method this way:

方法声明:

'fbml.dialog': {
    size : { width: 575, height: 300 },
    url : 'render_fbml.php',
    loggedOutIframe : true
}...

执行方法的函数:

// the basic call data
var call = {
  cb : cb,
  id : id,
  size : method.size || {},
  url : FB._domain.www + method.url,
  params : params
};

任何帮助将不胜感激......

Any help would be much appreciated...

推荐答案

在他们解决这个问题之前,我使用了一些 hacky 解决方法:

I've used a bit of a hacky workaround until they fix this:

http://pastebin.com/Qwu0bEed

相关文章