使用fancyBox v2和jQuery Cookie插件。每個會話在頁面加載時顯示fancybox
代碼:
var check_cookie = $.cookie('the_cookie');
if(check_cookie == null){
$.cookie('the_cookie', 'the_value');
$("#hidden_link").fancybox().trigger('click');
}
它的工作原理。但我想,當我關閉網站或瀏覽器並返回時,再次顯示fancybox。試過,但不工作:
var check_cookie = $.cookie('the_cookie');
if(check_cookie == null){
$("#hidden_link").fancybox().trigger('click'), {
'onComplete' : function() {
$.cookie('the_cookie', 'the_value');
}
});
}
通過DevTools經過,出現此錯誤:
Uncaught SyntaxError: Unexpected token) on 42.
42. line:
});
我怎樣才能解決這個問題?