Facebook Get Rid of Verticle Scroll Bars


/ Published in: JavaScript
Save to your folder(s)

Some FB apps are longer than the 800px default FB limit and most are designed to 520px. When your content is longer than the 800px default a verticle scroll bars appears and if you have a hard-coded width in your CSS of 520px this forces a horizontal scroll bar to appear when the verticle one does.

So lets get rid of the scroll bars once and for all!


Copy this code and paste it in your HTML
  1. <!--
  2. Paste this code at the bottom of each of your pages just before the closing </body> tag
  3. **Just don't forget to replace YOUR APP ID in the code below with guess what...? :o)
  4.  
  5. ***You might have to refresh a few times to see the changes!
  6. -->
  7.  
  8. <div id="fb-root"></div>
  9. <script src="http://connect.facebook.net/en_US/all.js"></script>
  10. <script>
  11. FB.init({
  12. appId : 'YOUR APP ID',
  13. status : true, // check login status
  14. cookie : true, // enable cookies to allow the server to access the session
  15. xfbml : true // parse XFBML
  16. });
  17.  
  18. </script>
  19. <script type="text/javascript">
  20. window.fbAsyncInit = function()
  21. {
  22. FB.Canvas.setSize();
  23. }
  24. // Do things that will sometimes call sizeChangeCallback()
  25. function sizeChangeCallback()
  26. {
  27. FB.Canvas.setSize();
  28. }
  29. sizeChangeCallback();
  30. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.