ghostcoder Posted September 6, 2012 Share Posted September 6, 2012 Ok, I'm using pushState, replaceState and popstate events along with Ajax to change content on a new project I'm working on. The basics are very simple and I've finally got it working well. However, I need to find a way to track and determine when a user is moving forward or back through the browser history, so that I can adjust the transitions properly. In my case, if someone goes back, I want the transition to be left to right, otherwise, right to left. I'm thinking the only way might be in a cookie. The system needs to remember history even if the person backs out of the site. ( as in, if you first load phpfreaks.com and the navigate to a site, move around a bit and then use the back button to go back to phpfreaks. Then, you may decide to click forward again to the site. Does anyone have any ideas on the easiest way to do this? Keeping some sort of array in a cookie, maybe? Quote Link to comment https://forums.phpfreaks.com/topic/268049-tracking-browser-navigation-direction-history-with-js/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.