Showing popup in the new Facebook JavaScript SDK

前端 未结 9 1483
遥遥无期
遥遥无期 2020-12-30 17:15

I used to have an href in my website. When users clicked on it, a multi-friend selector showed so they could invite their friends to my website. That was done u

相关标签:
9条回答
  • 2020-12-30 17:47

    you can also add display: 'dialog' and it will resize correctly.

    0 讨论(0)
  • 2020-12-30 17:48

    This works for me..

    FB.ui({method:'fbml.dialog', fbml:'<fb:request-form action="URL" method="post" invite="true" type="TYPE" content="THIS IS THE MESSAGE <fb:req-choice url=\'URL\'label=\'Accept\' />" <fb:multi-friend-selector showborder="false" actiontext="REQUEST FORM TITLE" /> </fb:request-form>'})});
    

    Replace the CAPS with your content.

    The only problem I'm having is I can't figure out how to resize the dialog to fit the content. It stays at 964px. I've tried many versions of

    size:(width:600,height:500),
    

    Any Ideas?

    0 讨论(0)
  • 2020-12-30 17:51

    try this:

        <script>
      var uiSize = FB.UIServer.Methods["fbml.dialog"].size;
    FB.UIServer.Methods["fbml.dialog"].size = {width:999};
    
      var dialog = {
        method: 'fbml.dialog',
        display: 'dialog',
        fbml: '<fb:request-form action="http://apps.facebook.com/xxxxx" method="post" target="_top" invite="true" type="Contest" content="Come and Join this contest!"> <fb:multi-friend-selector showborder="false" max="30" import_external_friends="false" email_invite="false" cols="5" actiontext="Invite your friends!" /></fb:request-form>',
      };
      FB.ui(dialog,function(response) {
            alert("fbDialogDismiss();");
        });
    </script>
    
    0 讨论(0)
提交回复
热议问题