Using fancyBox v2 and jQuery Cookie plugins.
Code:
var check_cookie = $.cookie('the_cookie');
if(check_cookie == null){
$.cookie('the_cookie', 'the_value');
$("#hidden_link").fancybox().trigger('click');
}
It works. But I want, when I close site or browser and come back, display fancybox again. Tried this but not working:
var check_cookie = $.cookie('the_cookie');
if(check_cookie == null){
$("#hidden_link").fancybox().trigger('click'), {
'onComplete' : function() {
$.cookie('the_cookie', 'the_value');
}
});
}
Checked via DevTools, get this error:
Uncaught SyntaxError: Unexpected token ) on 42.
42. line:
});
How can I fix it?