Facebook Scrollbar

Today I found out that the clearfix hack doesn’t do so well with Facebook. To avoid scrollbars in a facebook tab:

body, html {
    overflow:hidden;
}

and before the closing body tag:

<div id="fb-root"></div>
<script type="text/javascript" src="https://connect.facebook.net/de_DE/all.js"></script>
<script type="text/javascript">
        
          FB.init({
          appId  : 'APP_ID',
          status : true,
          cookie : true,
          xfbml  : true,
          oauth : true
        });

        $(document).ready( function(){
            FB.Canvas.setSize({ height: $('body').height() });
            FB.Canvas.scrollTo(0,0);
        });

        </script>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.