Open Colorbox for Newsletter signup on first web visit

Opens the first time, then leaves a cookie not to open for 15 more days.

the Javascript:

jQuery(document).ready(function ($) {
	
 if (document.cookie.indexOf('visited=true') == -1) {
        var fifteenDays = 1000*60*60*24*15;
        var expires = new Date((new Date()).valueOf() + fifteenDays);
        document.cookie = "visited=true;expires=" + expires.toUTCString();
        $.colorbox({width:"40%", inline:true, href:"#mc_form_pop"});
    }
});

 

Leave a Reply

Your email address will not be published. Required fields are marked *

31 − 30 =