I have a page that loads a fancybox popup and it works perfectly with the cookie for setting ho many days to show. the problem i have is that i need it to show 1 every 24 hours over a 3 day period. once the 3rd day is over and the user sees the window for the 3rd day i need a cookie set to never show the window again. here is my code as it sits now. I have worked with this for a couple of days on and off and it is above my head for sure.
any help is appreciated.
any help is appreciated.
$(function() {
if ($.cookie('moment_comm')) {
// it hasn't been 1 day yet
} else {
$("#autostart").fancybox({'overlayShow':true,frameWidth:
840,frameHeight:360}).trigger('click');
}
}
);
$('#autostart').live('click', function(e) {
e.preventDefault();
$.cookie("moment_comm", "true", { path: '/', expires: 1 });
$.fancybox.close()
});
Comment