在jquery.cookie.js插件上从天更改为秒

在jquery.cookie.js插件上从天更改为秒,jquery,cookies,plugins,format,Jquery,Cookies,Plugins,Format,你知道我如何在几秒钟内将这个js(工作)位格式化为插件设置的过期参数吗 以下是我所拥有的,运行良好(与ominflowWindow一起使用): 我可以直接编码到函数中吗 function OverlayClose() { jQuery(".ow-overlay, .modal").hide("slow"); } jQuery(document).ready(function () { if (jQuery.cookie('produ

你知道我如何在几秒钟内将这个js(工作)位格式化为插件设置的过期参数吗

以下是我所拥有的,运行良好(与ominflowWindow一起使用):

我可以直接编码到函数中吗

function OverlayClose() {
            jQuery(".ow-overlay, .modal").hide("slow");
        }
    jQuery(document).ready(function () {
        if (jQuery.cookie('product_2min_modal') == null) {
            jQuery.cookie('product_2min_modal', 'yes', {
                expires:  
var date = new Date();
 var minutes = 2;
 date.setTime(date.getTime() + (minutes * 60 * 1000));
 $.cookie("product_2min_modal", { expires: date });
,
                path: '/'
            });
            setTimeout(function () {
                jQuery('div.modal').omniWindow() // create modal
                .trigger('show');
            }, 5000 // and show it
            );
        }
    });
您有语法错误

function OverlayClose() {
    jQuery(".ow-overlay, .modal").hide("slow");
}
jQuery(document).ready(function () {
    if (jQuery.cookie('product_2min_modal') == null) {
        var date = new Date();
        var minutes = 2;
        date.setTime(date.getTime() + (minutes * 60 * 1000));
        jQuery.cookie('product_2min_modal', 'yes', {
            expires: date,
            path: '/'
        });
    }
});

令人惊叹的!那件事已经过去了!谢谢你把事情弄清楚,阿伦。明亮的
function OverlayClose() {
    jQuery(".ow-overlay, .modal").hide("slow");
}
jQuery(document).ready(function () {
    if (jQuery.cookie('product_2min_modal') == null) {
        var date = new Date();
        var minutes = 2;
        date.setTime(date.getTime() + (minutes * 60 * 1000));
        jQuery.cookie('product_2min_modal', 'yes', {
            expires: date,
            path: '/'
        });
    }
});