Quantcast
Channel: How to wait and fade an element out? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

How to wait and fade an element out?

$
0
0

I have an alert box to confirm that the user has successfully subscribed:

<div className="alert alert-success"><strong>Success!</strong> Thank you for subscribing!</div>    

When a user sends an email, I'm changing the "subscribed" state to true.

What I want is to:

  • Show the alert box when the subscribed state is true
  • Wait for 2 seconds
  • Make it fade out

How can I do this?


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>