How to make fadeOut effect with pure JavaScript

后端 未结 5 551
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 01:59

I\'m trying to make fadeOut effect for a div with pure JavaScript.

This is what I\'m currently using:

//Imagin         


        
5条回答
  •  抹茶落季
    2020-11-29 02:24

    you can use CSS transition property rather than doing vai timer in javascript. thats more performance oriented compared to what you are doing.

    check

    http://fvsch.com/code/transition-fade/test5.html#test3

提交回复
热议问题