I have a simple script to disappear on the website homepage, for example:
jQuery(document).ready(function(){
$('body.home').hide();
$('body.home').fadeIn('slow');
});
However, I would like the script to work only once as soon as the site loads initially. On subsequent clicks, when, say, the user goes to the secondary page and then returns to the home page, I don’t want the page to fade again, it should just be a downloadable page without fading.
Is there a way to do this with only jQuery code, maybe somehow to execute the function only once, and then stop it from executing? Any tips and code snippets would be greatly appreciated!
source
share