CSS animation doesn't restart when resetting class

后端 未结 8 1273
陌清茗
陌清茗 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条回答
  •  Happy的楠姐
    2020-12-01 15:26

    You definitely have to remove class that contains animation and then add it again. It should also work without .offsetWidth . It worked for me. So

    $('#id').removeClass('animationClass');
    $('#id').addClass('animationClass'); // starts animation again
    

    should do the trick.

提交回复
热议问题