JQuery using cookies
        Posted  
        
            by ChrisMJ
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by ChrisMJ
        
        
        
        Published on 2010-03-18T12:05:22Z
        Indexed on 
            2010/03/18
            12:21 UTC
        
        
        Read the original article
        Hit count: 341
        
Hi all, in my js file i want to be able to load a "splash screen" in a new air app im developing. At present when i call the splash screen it opens and closes fine, but its when i make it set a cookie it doesnt run at all. Please help...
    cookieSplash();
function cookieSplash(){
    var cookieSplash = $.cookie('loadSplash');
    if (cookieSplash == "true") {
        splash();
    };
    if (cookieSplash == "false") {
        loadApplication();
    };
}
function splash(){
    $("#viewport").append('<div id="splash"><img id="splash-close" src="/images/splash-logo.png" alt="click to close"></div>');
    $("#splash").click(function() {
        // Act on the event
        $("#splash").fadeOut("slow");
        $("#jettison").fadeIn("fast");
        $.cookie("loadSplash", "false");
    });
}
function loadApplication(){
    $("#jettison").fadeIn("fast");
}
Please help me out
© Stack Overflow or respective owner