The block element (#settings) responds to a click only if the click falls on an empty area. And if you directly click on the header (h1) or image, then this block element will not react to pressing. How to fix it?
<div id="settings"><h1>Π’Π΅ΠΊΡΡ</h1><img src="foto.jpg" alt="" width="28" height="28"></div> <div id="menu">ΠΠ΅Π½Ρ</div> <script> $(document).on('click', function(e) { if (e.target.id != 'settings' && e.target.id != 'menu') { $("#menu").hide(); } else if (e.target.id != 'menu') { $("#menu").toggle(); } }); </script> 