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
That first function should be different. An unset cookie won’t result in values like “true” or “false” (which as @rochal noted are strings, not booleans), it’ll be null. Also, if your cookie is keeping track of whether or not the splash screen needs to be shown, how will it have any value in it at all at first?