我有一個選項卡應用程序在高度和寬度上均設置爲流體。高度是沒有問題的......它是不工作的寬度,所以我的頁面的很大一部分(只有648px寬)沒有顯示出來。我們故意將寬度設置爲小於最大值,這樣我們就不會遇到這個問題。要查看您可以進入箭頭緊固件頁面比賽或像我們一樣輸入標籤。選項卡應用程序流體寬度不起作用
0
A
回答
1
選項卡應用程序只能使用固定寬度:520px。只有高度是可以設定的。
Fluid Width僅適用於Canvas Apps(apps.facebook.com/app-name),這就是爲什麼這些設置前綴爲「Canvas」(Canvas Width,Canvas Height)的原因。
Mike
0
在關閉正文標籤上方添加您的AppID和以下代碼。它將在選項卡上完美工作。
<script type="text/javascript">
fb_root = document.createElement('div');
fb_root.id = 'fb-root';
try
{
window.document.childNodes[0].appendChild(fb_root);
}
catch(error)
{
window.document.body.appendChild(fb_root);
}
window.fbAsyncInit = function() {
FB.init({
appId : '222222222222222', //your app ID
status : true, // check login status
cookie : true // enable cookies to allow the server to access the session
});
//FB.Canvas.setSize({ width: 520, height: 1400 });
function getDocHeight() {
var D = document;
return Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
}
var mySetSize = function() {
var height = getDocHeight();
FB.Canvas.setSize({ width: 520, height: height });
setTimeout(mySetSize, 200);
};
setTimeout(mySetSize, 200);
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
var head = document.getElementsByTagName('head')[0],
style = document.createElement('style'),
rules = document.createTextNode('body { position: relative; max-width: 520px!important;width: 520px!important; overflow: hidden!important; margin: 0px!important; }');
style.type = 'text/css';
if(style.styleSheet)
style.styleSheet.cssText = rules.nodeValue;
else style.appendChild(rules);
head.appendChild(style);
</script>
相關問題
- 1. 操作欄選項卡選項卡寬度不固定
- 2. 圖形高度/寬度的針織塊選項不起作用
- 3. 引導程序崩潰在選項卡中不起作用
- 4. 流體畫布(寬度)的Facebook應用程序
- 5. JQuery UI選項卡寬度JSON響應
- 6. 選項卡內的選項卡不起作用
- 7. SVG行程寬度不起作用
- 8. jquery選項卡不起作用
- 9. Bootstrap選項卡CSS不起作用
- 10. Bootstrap選項卡驗證不起作用
- 11. MySQL選項卡完成不起作用
- 12. jquery選項卡旋轉不起作用
- 13. UITabBarController選項卡不起作用
- 14. 多選項卡驗證不起作用
- 15. CSS寬度不起作用
- 16. div寬度不起作用?
- 17. fancybox.open寬度不起作用
- 18. Td寬度不起作用
- 19. 我的Flex 4應用程序的高度和寬度屬性不起作用?
- 20. wxPython wx.TextCtrl選項卡寬度
- 21. facebook業務頁面/選項卡的應用程序 - 嵌入的最大寬度
- 22. Facebook應用程序選項卡頁面上不工作
- 23. 角度材質選項卡中的Fabricjs畫布不起作用
- 24. 工作流程應用程序項目
- 25. GoWalla應用程序 - 選項卡
- 26. Facebook選項卡應用程序腳本
- 27. AngularJS選項卡應用程序
- 28. 多選項卡應用程序(C#)
- 29. Facebook應用程序選項卡
- 30. Eclipse應用程序選項卡