Skip to content

Instantly share code, notes, and snippets.

@Viktorminator
Created January 14, 2016 10:35
Show Gist options
  • Save Viktorminator/d7f3214551dde902eee4 to your computer and use it in GitHub Desktop.
Save Viktorminator/d7f3214551dde902eee4 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
function getCookie(name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
var cookie = getCookie('view_banner');
if(typeof(cookie)=='undefined') {
var date = new Date(new Date().getTime() + 60000 * 1000);
document.cookie = "view_banner=true; path=/; expires=" + date.toUTCString();
var items = [];
items.push('/assets/images/CG.png');
$.fancybox(items);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment