How to place facebook popup?

I use the facebook button below

<fb:login-button perms='email, user_photos, user_birthday, user_online_presence'
        autologoutlink='true'></fb:login-button>

Every time I click on it, a popup pops up to the right. How to install it in the center?

I tried on a clean page without any styles, tried in different browsers, and all the time only the login window floated to the right

+3
source share
1 answer

Try something like this:

   function popupFB() {

     // Modify window settings here 
     var width = 400;
     var height = 400;
     var left = parseInt((screen.availWidth/2) - (width/2));
     var top = parseInt((screen.availHeight/2) - (height/2));
     var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;


     //redirect_uri -where to redirect after the user approves your app 
     // scope - permissions separated by comma - like perms in the fb:login-button
     // APP_ID - your app id

     login_url = 'https://graph.facebook.com/oauth/authorize?client_id=APP_ID&scope=publish_stream&redirect_uri=window.location'; 

     window.open(login_url, "mywindow", windowFeatures);

   }

You need to add a custom login button that launches this function.

+3
source

Source: https://habr.com/ru/post/1796425/


All Articles