Как грамотно подключить cookie для всплывающего окна
Привет ребята.Нужна ваша помощь.
Не могу добавить (скорее не умею) условие cookie. Текущий скрипт автоматически полсле загрузки сайта загружает модальное окно. Как настроить так, чтобы он выводился один раз пользователю в день, точнее как грамотно вписать условие? Заранее спасибо за помощь. <!--// function iDarkWingBox_show() { if ('function' == typeof jQuery.fancybox) iDarkWingBox_showbox(); else { jQuery('#fancybox-wrap,#fancybox-tmp,#fancybox-loading,#fancybox-overlay,#fancybox-outer').remove(); jQuery.getScript('http://khairullin.ru/wp-content/plugins/darkwingpopup/fancybox/jquery.fancybox-1.3.4.js', iDarkWingBox_showbox); } } function iDarkWingBox_showbox() { document.cookie="iDarkWingBox=1347309956; path=/; expires=Tue, 10 Sep 2013 20:45:56 GMT;"; jQuery.fancybox('http://www.ed21.ru/Grey_Template.html', { 'width' : 280, 'height' : 280, 'type' : 'iframe', 'scrolling' : 'no', 'autoScale' : false, 'showCloseButton' : true, 'enableEscapeButton' : false, 'overlayOpacity' : 0.5, 'overlayShow' : true, 'transitionIn' : 'none', 'transitionOut' : 'none', 'centerOnScroll' : true, 'hideOnOverlayClick' : false, 'onClosed' : null }); } jQuery(document).ready(function(){ setTimeout("iDarkWingBox_show();", 4000); }); //--> |
Часовой пояс GMT +3, время: 15:21. |