How to resize Facebook Canvas app (iFrame) correctly?

前端 未结 10 612
走了就别回头了
走了就别回头了 2021-02-06 09:25

I need to adjust canvas size after updating content of a page. I can do it explicitly by

FB.Canvas.setSize({ width: 760, height: 1480 });

howev

10条回答
  •  情深已故
    2021-02-06 09:51

    I tried to use FB.Canvas.setSize(e); to resize my app, but it did not resize at all.

    I took a look in the Facebook Javascript and found out, that FB.Canvas.setSize calls the FB.Arbiter.inform('setSize',e) function.

    If I call the FB.Arbiter.inform('setSize',{ width: 760, height: 1480 }) function right from my code, the canvas resizes correctly.

提交回复
热议问题