scrollTop doesn't scroll on Chrome 61

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scrollTop doesn't scroll on Chrome 61相关的知识,希望对你有一定的参考价值。

在chrome61 不支持滚动 解决方案:

Use document.scrollingElement if supported, and fall back to the current code.

For example, if the current (problematic) code is something like:

function bodyOrhtml() => {
	if (navigator.userAgent.indexOf(‘WebKit‘) != -1) {
		return document.body;
	}
	return document.documentElement;
}
...
bodyOrHtml().scrollTop = 100;

 

下面是最好的解决方法:

function bodyOrHtml() => {
	if (‘scrollingElement‘ in document) {
		return document.scrollingElement;
	}
	// Fallback for legacy browsers
	if (navigator.userAgent.indexOf(‘WebKit‘) != -1) {
		return document.body;
	}
	return document.documentElement;
}
...
bodyOrHtml().scrollTop = 100;


参考:https://dev.opera.com/articles/fixing-the-scrolltop-bug/



以上是关于scrollTop doesn't scroll on Chrome 61的主要内容,如果未能解决你的问题,请参考以下文章

Bug? #1146 - Table 'xxx.xxxxx' doesn't exist

mysql 提示table doesn't exist

hibernate-Table 'XXX.XXX' doesn't exist

ibernate报错 :all_sequences' doesn't exist.

Table 'mxonline.xadmin_log' doesn't exist

报错:Table 'sell.hibernate_sequence' doesn't exist