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> 
  • one
    and what do you have with js-code? why two times the same condition, what a strange, divorced from reality 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 Pshenitsyn
  • did the editing .. - t0rick
  • the questions are the same: what is the incomprehensible if 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
  • Why do you have the same condition two times in a row? combine them. - Ivan Pshenitsyn
  • and clarify how it behaves at the moment? error in the console spits? just silently not working? or something different? - Ivan Pshenitsyn

0