Addition to the previous question, which was incorrectly asked. I can not ensure that the stickybar always opens until it is closed, that is, when switching to another page so that the stickybar was always open. Here is the actual stickybar code:
<div class="popupstick"> <span class="hlas">Hlasujte v anketÄ› "ÄŚtenáři Receptáře doporuÄŤujĂ" <a href="http://www.ireceptar.cz/ctenari-doporucuji/">a zĂskejte ZDARMA Edici Receptáře</a></span> <button class="close-stick" title="Close" onclick="(document.getElementsByClassName('popupstick')[0]).style.display='none';setCookie('hideModal', '2', 7) ;">x</button> </div>
But javascript with a working cookie, but only for popup.
<script type="text/javascript"> function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } { var delay_popup = 1000; if (getCookie('hideModal')=="") { setTimeout("document.getElementById('overlay').style.display='block'", delay_popup); } if (getCookie('hideModal')=="") { setTimeout("document.getElementsByClassName('popupstick')[0].style.display='block'", delay_popup); }; </script>
if
in the end? what incomprehensible closed parentheses};
? still wondering where is the opening code of the sticybar? I see the closing code, show the opening code. - Ivan Pshenitsynif
at the end? What a strange construction} {
in the middle? And what is the closed bracket at the end? Understand the code, put the syntax in order. If you open it in a normal code editor, it will immediately highlight errors in red. - Ivan Pshenitsyn