<div class="animate__animated animate__fadeInUp animate__fast" role="alert">
<strong>${alertmsg}</strong> ${msg}
<button type="button" class="btn-close" aria-label="Close"></button>
</div>
how can I make it to fade out after pressing the close button?
if I included both animate__fadeInUp
and animate__fadeOutUp
class, it will just fadeout directly.
4
Answers
You can achieve the fadeout effect using this:
I feel you could just add and remove classes using normal DOM-manipulation for the desired effect, right?
Here’s an example,
Let me know if this helps
Cheers
This can be achieved using this:
You can use JavaScript or jQuery to add the animate__fadeOutUp class to the element when the button is clicked.
Here is an example:
JS::
jQuery::
Make sure to include the jQuery library if you choose to use the jQuery version