0
我有一個腳本我正在使用加載窗口,設置cookie,但窗口不會再次出現,如果用戶點擊「不,謝謝」,但我想如果他們也點擊「進行調查」,窗口不會出現。我嘗試在這裏添加第二個ID $('#modal_close, #modal_exit').live('click', function(e) {
,但它不起作用。而不是去調查的鏈接,它進入模式從發射的頁面。任何線索和/或幫助?jQuery:Modal窗口加載fancybox + cookies
$(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()
});
}
})我要尋找節目的價值;