0
我們用fancybox構建了一個通知,需要向所有用戶顯示一次,但目前它在網站的每個頁面上都顯示一次,併爲訪問者訪問的每個頁面設置一個cookie ,我們的代碼如下:jquery cookie - 每個站點而不是每頁
// jQuery Cookie popup
$(function() {
if ($.cookie('cd-notification-cookie')) {
// it hasn't been three days yet
} else {
$.fancybox.open([
{
href : '#notification'
}
], {
maxWidth : 420,
maxHeight : 800,
fitToView : false,
width : '90%',
height : 'auto',
autoSize : false,
closeClick : false,
closeEffect : 'none'
});
// set cookie to expire in 3 days
$.cookie('cd-notification-cookie', 'true', { expires: 3});
}
});
是否有可能爲整個網站,而不是按頁全球餅乾嗎?