2011-03-05 111 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); 

    } 

您必須添加自定義登錄按鈕觸發這個功能。