views:

34

answers:

2

I have a simple animation based on jQuery fadeIn and fadeOut - it just shows some elements and hides others sequentially when a visitor loads main page of the site. So, I use this animation only on one page. I only want this to be shown one time per session so that when user clicks "Home", this wouldn't show up any more, just skipped. How can I implement this?

+3  A: 

you can implement it with a cookie. check if the user has the cookie, if(yes) then don't run the animation, else, do show.

Avi Tzurel
+2  A: 

Take a look at Cookies and HTML5 Storage.

Html 5 storage can be used with the plugin JStorage

Example

$(document).ready(function(){
  if($.JStorage.get('intro_played') == false)
  {
     //Play the sexyness.
  }
});

Theres also a cookie plug-in that works in exactly the same way apart from he data is stored differently on user end.

RobertPitt