2011-03-05 102 views
3

我使用下面如何定位Facebook的弹出窗口?

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

每次Facebook的按钮,我点击了浮动到右打开弹出窗口。如何将其设置为中心?

我试图清理页面上没有任何风格在不同的浏览器尝试和所有的时间只需登录窗口中,右键浮动

回答

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); 

    } 

您必须添加自定义登录按钮触发这个功能。