title: remember a variable's history
body: <p>Let's say I have a page that slides right and left and loads new content using ajax. A variable gets set to leftslide or rightslide depending on the slide direction.</p>
  
  <p>When you click the back button in the browser the html5 popstate event enables and loads the last page using ajax. Now using the variable I can determin what direction to slide in when the back button is pushed <code>if (var  direction == 'leftslide'){ direction = 'rightslide'}</code> (to get a nice "back" effect).</p>
  
  <p>But if you push the backbutton twice the slide will not always be correct sine it will just reverse the slide instead of looking at the slide of that paticular page.</p>
  
  <p>So is there any way to save a variables history and get the order back using javascript?</p>
  
  <p>thanks for reading and thinking about this :)</p>