Using CSS animation while javascript computes

孤街浪徒 提交于 2019-12-05 06:27:35

CSS3 animations do not get blocked by Javascript unless there is some intense processing going on (in which case you could get stutters).

If you are triggering them during the load I could see them getting delayed until they get to that portion of the script.

One way around this is to setTimeouts at the very beginning of the script to trigger animation changes at certain times.

Another (perhaps better) option would be to use keyframes. Make sure to call this before the loading begins. http://dev.w3.org/csswg/css3-animations/#keyframes

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