here I am trying to hide one div if the display property of another div changed from none to block.
$(document).ready(function(){
// Set div display to none
$("#div2").click(function(){
if($('#div2').is(':visible')){
$(".div1").css("display", "none");
}
});
});
I am using this code, but as you can see it only works on click. The display property of div2 is set to none. However, it will change to the block later. I want to run this function immediately after the display property of div2 is changed from none to block. HTML code is here
<div class="div1">Some Content Here<div>
<div id="div2" style="display:none"></div>