2012-05-11 52 views
3

我又來了。FancyBox-格式的Jquery cookie插件FancyBox

我能夠從堆棧溢出的另一個問題設置使用這段代碼爲我的fancybox餅乾:

$(document).ready(function(){ 

var check_cookie = $.cookie('the_cookie'); 

if(check_cookie == null){ 

    $.fancybox('<h2>Some content</h2>', { 
     'onComplete' : function() { 
       $.cookie('the_cookie', 'the_value'); 
     } 
    }); 
} 
}); 

這可能是一個愚蠢的問題,但現在我的問題是,我已經失去了格式化我的FancyBox。有人可以告訴我,我應該把這個代碼放在哪裏,以便我可以有我的cookies和格式?

{ 
    'autoDimensions' : false, 
    'width'    : 450, 
    'height'   : 190, 
    'transitionIn'  : 'none', 
    'transitionOut'  : 'none' 
} 

回答

2
$(document).ready(function(){ 

var check_cookie = $.cookie('the_cookie'); 

if(check_cookie == null){ 

    $.fancybox('<h2>Some content</h2>', { 
     'autoDimensions' : false, 
     'width'    : 450, 
     'height'   : 190, 
     'transitionIn'  : 'none', 
     'transitionOut'  : 'none', 
     'onComplete' : function() { 
       $.cookie('the_cookie', 'the_value'); 
     } 
    }); 
} 
});