新页面加载时 Facebook iframe 不会出现在顶部
我创建了一个 facebook iframe 页面选项卡,它链接到我的网站。问题是,当我在 iframe 中向下滚动以查看内容并单击下一页时,它会加载,但该页面将与上一页一样对齐,因此我必须向上滚动。
如何解决这个问题,以便当我单击下一页时,新页面将从顶部对齐,而不是与 iframe 中的上一页对齐?
我研究了几个小时,听说下面的代码将有助于解决这个问题,但我不知道如何编码。
FB.Canvas.scrollTo(0,0);
如何编码才能加载 javascript SDK 和 FB.Canvas.scrollTo(0,0);?
还有其他选择可以解决这个问题吗?
I created a facebook iframe page tab which is link to my website. The problem is when I scroll down within the iframe to view the content and click on the next page, it would load but the page will be aligned just as the previous page so that I have to scroll upwards.
How do I fix it so that when I click on the next page, the new page would aligned from the top and not aligned as the previous page in iframe?
I research for hours and heard that the following code will help solved it, but I don't know how to code it.
FB.Canvas.scrollTo(0,0);
How do you code it so that it would load the javascript SDK and FB.Canvas.scrollTo(0,0);?
Is there another option to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是您需要的完整脚本。
如果您还有其他问题,请阅读本教程 - http://ftutorials.com/scroll-to-top/
This is the full script you need.
If you have further questions, read this tutorial - http://ftutorials.com/scroll-to-top/