Facebook IFrame Tab Resize Fix

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

This script will handle any vertical resizing issues with a Facebook IFrame tab application, such as the resizing of the frame when elements expand, such as a Facebook Comments plugin. It uses the "FB.Canvas.setAutoResize" method from the Facebook JavaScript SDK, so that must be initialized with a Facebook Application ID; for more information, see http://developers.facebook.com/docs/reference/javascript/

Copy this code and paste it in your HTML
  1. (function() {
  2. FB.Canvas.setAutoResize();
  3. document.body.addEventListener('onresize', 'FB.Canvas.setAutoResize');
  4. })();

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.