I have an issue with my project.
I have this code to make disappear my div :
@keyframes hideAnimation {
to {
visibility: hidden;
}
}
On my div I do this animation to make disappear my div after 6 seconds
.env{
animation: hideAnimation 0s ease-in 6s;
animation-fill-mode: forwards;
}
My issue is : I want to create a button to reappear my div
The div disappear automatically after 6 seconds and the user can make reappear the div with a click on a button.
I don’t know how to do that.
I think I will use JS or jQuery but I’m lost.
Can someone can help me ?
2
Answers
So, you need the button on
click
to get thediv
you want to reappear, and set itsvisibility: visible;
For example
For more resources
If your goal is to fade in/out the div then
keyframes
is overkill. You can usetransition
withopacity
instead.