Chrome Bug - window.scroll method intercepts DOM Rendering

霸气de小男生 提交于 2019-12-06 15:31:49

I figured it out. Chrom has a rendering bug.

If you call a window scroll function, immediately after you update some DOM properties, Chrom won't fully render all your DOM modifications.

To fix the problem, I replace this line:

window.scroll(0,docPos);

With this line:

setTimeout('window.scroll(0,' + docPos + ')',1);

This gives Chrom the ability to render the dom changes before the window-scroll-rendering bug can stop it.

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