Is there a way of detecting if the browser will freeze the DOM while scrolling?

守給你的承諾、 提交于 2019-12-22 08:49:53

问题


Is there a way of detecting if the browser will freeze the DOM or disable JavaScript while scrolling? It's known that some mobile browsers do this, and it effectively kills scrolling-based effects like parallax and animations. I'd like to effectively implement the following pseudocode without resorting to UA sniffing:

if (!browserWillFreezeWhileScrolling) {
    initializeScrollingEffects();
} else {
    initializeFallbackScript(); // maybe unnecessary
}

From what I can see, Modernizr doesn't check it.

来源:https://stackoverflow.com/questions/17205074/is-there-a-way-of-detecting-if-the-browser-will-freeze-the-dom-while-scrolling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!