Home How would I create a div that starts disappearing after 3 seconds?
Reply: 0

How would I create a div that starts disappearing after 3 seconds?

user535
1#
user535 Published in April 22, 2018, 12:58 am

I want to have an div visible at the top of my page by default, however when you load the page a 3 second timer starts after which that div begins to fade out until it disappears. I have a few ideas about how to do this, but I'm not entirely sure:

  1. set transition of div in css to however long I want it to spend fading out, and set background color/color to rgba values with 0 opacity
  2. Use setTimeout to create the 3 second timer at the beginning when the page loads
  3. I'm stuck...
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303932 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO