Trying to get an overlaid div to fadeout to reveal my blog only the first time a user accesses the site. Right now it's loading every time I go back to the home page. How can I modify what I have below to make it only load the first time the page is loaded, not every time the home page is accessed?
<script>
var flag=true;
$(document).ready(function(){
if(flag){
setTimeout(function(){ $('#fadeout_image_div').fadeOut('slow') }, 2000);
flag=false};
//the else statement I'm not so sure about, I was trying to hide the div if the flag was set
else
$('#fadeout_image_div').css('display', 'none');
});
Logically I thought this would work but it doesn't appear to be doing so. I don't think the flag is being recognized. It still fadesout every time the home page is accessed. Still relatively new to jQuery so any help is much appreciated.