Single Page Navigation w/ Javascript and Back Button

Posted by Khan on Stack Overflow See other posts from Stack Overflow or by Khan
Published on 2010-05-10T21:20:09Z Indexed on 2010/05/10 21:24 UTC
Read the original article Hit count: 384

Filed under:
|
|
|
|

Ok, so I have a "navigation" div and "content" div.

When something on the navigation is clicked, I fade in the content div with the new data.

Now, I would like to have the old data returned when the user hits the "back" button on his/her browser, but I'm having a hard time doing this.

I know I can set the content to be a named anchor, so they stay on the same page with a breadcrumb trail. However, that's as far as I get. Can I listen for a back button click? Can I set content to display when a certain anchor name is reached?

Thanks in advance for your help, SO.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about navigation