Updating animation-duration in Javascript

后端 未结 3 1665
梦毁少年i
梦毁少年i 2021-01-21 00:54

After changing the animation-duration (or in this case, -webkit-animation-duration) property via JavaScript with setProperty(\"-webkit-animation-

3条回答
  •  萌比男神i
    2021-01-21 01:33

    in w3c standard, it says that it doesn't mention we can change the animation duration time or not. so it all depends on explorer.chrome yes, but ie no. So, we should update the whole animation when we want to change the time.

    var animation = 'animationName time linear infinite'; var $element= $('selector').css('animation', 'none'); setTimeout(function(){ $element.css('animation', animation); }); this work on IE

提交回复
热议问题