I've got an animation that I want to play only once and I figured that since the animation was in JQuery, the function to write the cookie file should be as well.
So far I've got:
$(document).ready(function(){
if (!$.cookie('cookieName'))
{
setTimeout(function() {
$('#intro').fadeOut(1000);
}, 5000);
};
$.cookie('cookieName', 'the_value');
});
I guess I was thinking this was going to check to see if there was a cookie and if not then play the animation. When that was done it writes a cookie and so when I come back to the page it doesn't play. I'm calling the Klaus Hartl cookie plugin and for some reason this just isn't doing it for me.
Much appreciated.