我可以在下面添加什麼來防止在除夕晚上8點之後彈出窗口?爲具有Cookie的彈出窗口設置到期日期(和時間)
$(document).ready(function(){
// Start Cookie for PopUp
if (document.cookie.indexOf('colorframe=true') === -1) {
var expires = new Date();
expires.setDate(expires.getDate()+1);
document.cookie = "colorframe=true; escKey=true; expires="+expires.toUTCString();
// Start Popup
setTimeout(function() {
$.colorbox({
escKey: true,
html: '<a href="---"><img src="---" width="550" height="550" alt="New Years Eve at ---"/></a>'
});
}, 2000);
};
});
根據當地時區或服務器的時區爲晚上8點? – yts
偉大的問題。格林威治標準時間5或EST ... – mdnash