If I had a pair of <div>
elements set up like this:
<div class="overlay"></div>
<!-- More content here -->
<div class="popup"></div>
Whenever the div.popup
element is displayed with display: block
, I want the div.overlay
to be displayed with display: block
as well, and vice versa for display: none;
Instead of relying on an if statement to check the visibility of div.popup
, I am looking for a solution using an event handler.
Can someone provide guidance on how to achieve this functionality using jQuery? Appreciate your help.