There is a script for opening the menu and closing it is necessary that after 10 seconds the block is closed, but only if the mouse is outside the block, and if the mouse is on the block so that it does not close
I tried it but it does not work:
$(document).ready(function(){ $("#closea").click(); $("#closediv").fadeIn(); }); $(function() { $("#closea").click(function() { if ($(this).hasClass("closea")) { $(this).removeClass("closea"); $("#closeimg").attr("src", "../img/up.png"); var k=0; $(".close").mouseover(function(){k=1;}); if(k==1){ setTimeout(function(){ $("#closea").addClass("closea"); $("#closeimg").attr("src", "../img/down.png"); $("#closediv").slideToggle("slow"); },5000); }else{ k=0; } } else { $(this).addClass("closea"); $("#closeimg").attr("src", "../img/down.png"); } $("#closediv").slideToggle("slow"); }); }); <div class='close'> <div id='closediv'> контент в блоке </div> <a id='closea' onclick="close(this)" class="closea"> <img id='closeimg' src="../img/up.png" style="width:30px"> </a> </div>
});- tCode