Skip to content

Instantly share code, notes, and snippets.

@TheGP
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save TheGP/97de2814fb3dcd7ad449 to your computer and use it in GitHub Desktop.

Select an option

Save TheGP/97de2814fb3dcd7ad449 to your computer and use it in GitHub Desktop.
jumpout - show popup every time
<script>
function ss_create_cookie(e,n,t){if(t){var o=new Date;o.setTime(o.getTime()+24*t*60*60*1e3);var i="; expires="+o.toGMTString()}else var i="";var r=document.domain.substring(document.domain.lastIndexOf(".",document.domain.lastIndexOf(".")-1)+1);document.cookie=e+"="+n+i+"; path=/;domain=."+(6<r.length?r:document.domain)}
function ss_read_cookie(e){for(var n=e+"=",t=document.cookie.split(";"),o=0;o<t.length;o++){for(var i=t[o];" "==i.charAt(0);)i=i.substring(1,i.length);if(0==i.indexOf(n))return i.substring(n.length,i.length)}return null}
var popups_to_show_always = [85]; /* сюда записываем id попапов которые должны постоянно работать*/
var ss_clean_cookies = function(){
for (key in popups_to_show_always) {
var pp_id = popups_to_show_always[key];
if (null !== ss_read_cookie('jo_do_not_show[' + pp_id + ']')) {
ss_create_cookie('jo_do_not_show[' + pp_id + ']', '', -1);
}
}
};
setInterval(ss_clean_cookies, 1000);
ss_clean_cookies();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment