Skip to content

Instantly share code, notes, and snippets.

@lightyoruichi
Created November 29, 2011 03:40
Show Gist options
  • Save lightyoruichi/1403304 to your computer and use it in GitHub Desktop.
Save lightyoruichi/1403304 to your computer and use it in GitHub Desktop.
facebook app width fluid
// Load body and before content divs
<body style="margin:0; padding:0; border:0">
<div id="allContent" style="height:100%">
<div id="output" />
</div>
<div id="fb-root"></div>
// Add this before closing body
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
FB.init({
appId : 'APP ID',
});
function echoSize() {
document.getElementById('output').innerHTML =
"HTML Content Width: " + window.innerWidth +
" Height: " + window.innerHeight;
console.log(window.innerWidth + ' x ' + window.innerHeight);
}
echoSize();
window.onresize = echoSize;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment