我正在使用下方的facebook按钮
<fb:login-button perms='email, user_photos, user_birthday, user_online_presence'
autologoutlink='true'></fb:login-button>
每次我点击它时,它的开启弹出窗口都向右浮动。如何将其设置为中心?
我尝试在干净的页面上没有在不同的浏览器中尝试任何样式,并且一直只是登录窗口浮动
答案 0 :(得分:3)
尝试这样的事情:
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);
}
您必须添加一个触发此功能的自定义登录按钮。