CSS animation doesn't restart when resetting class

后端 未结 8 1279
陌清茗
陌清茗 2020-12-01 14:58

I am using CSS shader + animation. My shader class is defined as follows:

.shader{
-webkit-filter :custom(url(v.vs) mix(url(f.fs) multiply destination-over),         


        
8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 15:45

    I'd be happy to hear any criticism with my method using requestAnimationFrame as I don't see anyone else using it:

    element.classList.add("class");
    window.requestAnimationFrame(() => element.classList.remove("class"));
    

提交回复
热议问题