Sign in to follow this  
jeff8j

Facebook html canvas 100% viewable area

Recommended Posts

I am trying to get my html5 game on facebook and trying to find a way for it to fill the entire viewable screen but sometimes the ads make the page longer and it goes past the viewport.

I can get it working locally but wont work view facebooks iframe
If you try this it fills the screen and still allows for you to scroll how can I do the same in the iframe?
[CODE]
<html>
<head>
<style>
* {margin:0;padding:0}
</style>
</head>
<body>
<div style="width:100%;height:100%;background-color:#000"></div>
<br>
Bottom
</body>
</html>
[/CODE]

Share this post


Link to post
Share on other sites
Well the facebook code they give works for the viewport but then when I go to fill up the bottom area to have content where the ads are the iframe is only the viewport size so I end up getting a scroll bar instead of filling in the whitespace.

I was thinking if I can get the size of the entire viewport with javascript I could just resize everything minus the top and right bars but I cannot seem to get the parent window? Is there a way to figure out the whole screen width?

Share this post


Link to post
Share on other sites
Wait... do you mean that you're trying to cover up or replace the ads? That isn't supported, for what I think are pretty obvious reasons...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this