css transitions on new elements

后端 未结 3 2127
长情又很酷
长情又很酷 2020-12-01 05:03

I cannot find a way to use css transitions on newly created dom elements.

let\'s say I have an empty html document.



        
3条回答
  •  清歌不尽
    2020-12-01 05:49

    I found a nicer way to trigger layout and make transitions work just after appending the element to the DOM:

    window.getComputedStyle(element).opacity;
    

提交回复
热议问题