There is such a small code for feedback and I'm confused with it. the question is how, when pressed, hide where you clicked and open another block (which is already working). And just do the opposite, clicking on the second block (hiding) that would open the first.
<a onclick="onclickVhod();" id="idExid"class="popup_toggle"> <div class="circlephone" style="transform-origin: center;"></div> <div class="circle-fill" style="transform-origin: center;"></div> <div class="img-circle" style="transform-origin: center;"> <div class="img-circleblock" style="transform-origin: center;"></div></div> </a> <span onclick="onclickExid()" id="idVhod" ><span id="ugcontcal"></span></span> <script> var idVhod = document.getElementById('idVhod'); function onclickVhod() { idVhod.style.display = (idVhod.style.display == 'inline') ? '' : 'inline'; localStorage.setItem('hide', idVhod.style.display); // сохраняем значение в ключ hide } if(localStorage.getItem('hide') == 'inline') { // если значение ключа hide "inline" document.getElementById('idVhod').style.display = 'inline'; } var idExid = document.getElementById('idExid'); function onclickExid() { idExid.style.display = (idExid.style.display == 'none') ? '' : 'none'; localStorage.setItem('hide', idExid.style.display); // сохраняем значение в ключ hide } if(localStorage.getItem('hide') == 'none') { // если значение ключа hide "none" document.getElementById('idExid').style.display = 'none'; } </script>
localstorageIf the page is reloaded, then you will still have to check the current value inlocalstorage- ZIBER MINSK