How to make JavaScript SDK resize the iFrame canvas automatically?

I believe for all the new canvas apps that you are to create, they would be iframe canvas apps.

For me, one of the problems that I encountered occasionally is about the size of the iframe used as the canvas. There are 2 major problems.

  1. Scrollbars are sometimes displayed.
    Based on my experience, this usually relate to badly formatted HTML codes that have large amount of nested DIV areas. Cleaning up the HTML codes and layout is the key to fix the problem.
  2. iframe height is not reduced automatically when moving from a long page to a short page.
    At this moment, I don’t find a “bullet-proof” solution and I have to see which of the methods works (such as setting the size explicitly).

Do you have similar problems?  If yes, then how you handle it?

This entry was posted in Development Tips and tagged . Bookmark the permalink.

One Response to How to make JavaScript SDK resize the iFrame canvas automatically?

  1. eivai says:

    I was looking for this kind of review for about 1 hour.. i’m glad i found it. Great piece of work, continue it. Best Regards.

Leave a Reply

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