I have a DIV
with default display:none
. It uses the class overlay
defined as:
.overlay
{
display:none;
position:absolute;
top:0;
left:0;
z-index:200;
width:100%;
height:100vh;
background:black;
}
Clicking a button, I simply add it the following class with jQuery:
.open {
display:block;
}
As you can see, it is simply rendered as a full window overlay.
I would like to add some opening/closing effect and not simply toggle it's display
property, (fade or translate, I don't know yet what).
I would like to use CSS transitions but how to add them in the correct way? The problem is obviously more evident at closing because I anyway need to apply display:none;
at the end of closing transition.