jQuery animate function equivalent in pure JavaScript

后端 未结 3 1141
别那么骄傲
别那么骄傲 2020-12-29 05:35

What is the equivalent of the following jQuery animate in pure JavaScript?

3条回答
  •  温柔的废话
    2020-12-29 06:04

    Element.animate() function seems to be very simple and useful. But there are for now a lot of compatibility issues. You can read about it:

    https://developer.mozilla.org/en-US/docs/Web/API/Element/animate

    I would recommend to get used to requestAnmationFrame. It's compatible with all browsers and it is very powerful:

    https://javascript.info/js-animation

提交回复
热议问题