У меня есть сценарий, который я использую, который загружает окно, устанавливает файл cookie, но окно больше не появляется, если пользователь нажимает «Нет, спасибо», но я хочу, чтобы окно не появлялось, если они также нажимают «Взять». Опрос". Я попытался добавить второй идентификатор здесь $('#modal_close, #modal_exit').live('click', function(e) {
, но это не сработало. Вместо того, чтобы переходить по ссылке на опрос, он переходит на страницу, с которой запускается модальное окно. Любые подсказки и / или помощь?
$(document).ready(function(){
// МОДАЛЬНОЕ ОКНО, если запрошенный файл cookie не имеет значения, которое я ищу, показать модальное окно
if($.cookie("cookieName") != 'true')
{
var _message_to_show = 'Window Content Goes Here';
// on page load show the modal box
// more info about the options you can find on the fancybox site
$.fancybox(
_message_to_show,
{
'width' : 550,
'height' : 275,
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'centerOnScroll' : 'true',
'overlayOpacity' : 0.8,
'overlayColor' : '#000',
'modal' : 'true',
'padding' : 5
}
);
// in the message is a link with the id "modal_close"
// when you click on that link the modal will close and the cookie is set to "true"
// path "/" means it's active for the entire root site.. if you set it to "/admin" will be active on the "admin" folder
// expires in 7 days
// "modal" is the name i gave the cookie, you can name it anything you want
$('#modal_close').live('click', function(e) {
e.preventDefault();
$.cookie("cookieName", "true", { path: '/', expires: 7 });
$.fancybox.close()
});
}
});