<button class='show'>show</button><button class='show2'>show2</button>
<p>When showing or hiding a modal typically a display: none is involved because otherwise the modal will cover the content below it. Even though not seen, the modal will block interaction with the content.</p>
<p>If the modal is to pop into and out existence then this is no big deal, but gets trickier if a fade and/or movement is desired. Because using display: none will often cause the animation to not be seen as it pops out of view immediately.</p>
<p>We get around this having the modal translate into and out of position. When we apply the "show" class we only transition the opacity so that that transform is immediate. But when we remove the "show" class it falls back to the default transition; which is to transition the opacity immediately but have a transform transition as well that is delayed by the same time used for opacity.</p>
<p>In this way, once the fade out is completed the transform transitions instantly because we have a transition time of zero. Once the transition has moved the modal out of the way it no longer blocks interaction with the content.</p>
<div id='modalback'><div id='modal'>click to close</div></div>
<div id='popover'>click to close</div>