FB.ui and setting popup size

橙三吉。 提交于 2019-12-05 03:13:51

问题


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

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,
...

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

Method declaration:

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

Functions that executes the methods:

// 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...


回答1:


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

http://pastebin.com/Qwu0bEed




回答2:


if you change it to

display: 'dialog'

it will resize correctly




回答3:


Use

FB.UIServer.Methods["fbml.dialog"].size = {width:640, height:400};


来源:https://stackoverflow.com/questions/2948517/fb-ui-and-setting-popup-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!