Messenger聊天插件在加载时滚动到顶部 [英] Messenger chat plugin scrolls to top on load

查看:94
本文介绍了Messenger聊天插件在加载时滚动到顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用哈希参数自动将页面滚动到页面加载时的锚点时,如果延迟加载,则Messenger聊天插件会自动将页面滚动到顶部.这发生在我的物理移动设备和模拟器(Chrome)中.是否需要采取任何措施来防止这种行为?

When using hash parameters to automatically scroll the page to an anchor on page load, the messenger chat plugin automatically scrolls the page to the top if its load is delayed. This happens on my physical mobile device and in an emulator (Chrome). Is there any step required to prevent this behaviour?

推荐答案

该错误当前正在此处跟踪:

The bug is currently being tracked here: https://developers.facebook.com/support/bugs/619023102320436/.

目前,我已经实现了以下hack(在插件的加载时间附近):

At the moment I have implemented the following hack (around the load time of the plugin):

var originalScrollTo = window.scrollTo;
window.scrollTo = function() {};

setTimeout(function() {
 window.scrollTo = originalScrollTo;
}, 5000);

这篇关于Messenger聊天插件在加载时滚动到顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆