I have a pop-up with a cookie that expires in one day (24 hours) and I would like that this cookie expires at midnight everyday (so the pop-up shows the first time you enter to the web every day). I'm not a programmer, so, please, could someone tell me what I have to change in my code? I have read some solutions to my question, but I don't know how to implement it.
//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
if ($.cookie("anewsletter") != 1) {
//centering with css
centerPopup();
//load popup
loadPopup();
}
//CLOSING POPUP
//Click the x event!
$("#popupContactClose").click(function(){
disablePopup();
$.cookie("anewsletter", "1", { expires: 1 });
});
//Click the bacground!
$("#backgroundPopup").click(function(){
disablePopup();
$.cookie("anewsletter", "1", { expires: 1 });
});
//Press Escape event!
$(document).keypress(function(e){
if(e.keyCode==27 && popupStatus==1){
disablePopup();
$.cookie("anewsletter", "1", { expires: 1 });
}
});
});
Thank you very much!