How to make fadeOut effect with pure JavaScript
Initially when there’s no opacity set, the value will be an empty string, which will cause your arithmetic to fail. That is, “” < 0.1 == true and your code goes into the clearInterval branch. You can default it to 1 and it will work. Expand snippet An empty string seems like it’s treated as … Read more