我使用了我从git获得的代码.它基本上设置为设置一个cookie,以便在第一次访问该站点时显示弹出窗口.但是,我希望它只能设置24小时.因此,如果某人在一两天内回到该网站,它将再次显示.
(function ($) {
'use strict';
$.fn.firstVisitPopup = function (settings) {
var $body = $('body');
var $dialog = $(this);
var $blackout;
var setCookie = function (name, value) {
var date = new Date(),
expires = 'expires=';
date.setTime(date.getTime() + 31536000000);
expires += date.toGMTString();
document.cookie = name + '=' + value + '; ' + expires + '; path=/';
}
var getCookie = function (name) {
var allCookies = document.cookie.split(';'),
cookieCounter = 0,
currentCookie = '';
for (cookieCounter = 0; cookieCounter < …Run Code Online (Sandbox Code Playgroud)