知道如何让这个(工作的)js 位在几秒钟内被格式化为https://github.com/carhartl/插件设置的过期参数吗?
这是我所拥有的,运行良好(也与 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: 1,
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) {
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
);
}
});