anchor navigation with # and non-functioning browser history

They have: 5 posts

Joined: Jun 2006

Hello all,

I have a basic html document that contains anchors for every chapter.

...

Navigation throught the document is working without a problem, document rolls on correct position according to the clicked menu position, but the problem arises when I want to go to the previous document position using browser back button. The address in address bar changes to the correct anchor position but the document doesn't roll to the correct position and nothing changes.

Does anybody know where is the problem? Thanks for every advice.

Kind regards,

Boris

Busy's picture

He has: 6,151 posts

Joined: May 2001

You'll find it will work on some browsers not others - it's a browser problem, nothing you can do about it.

How about instead of suggesting (if you do) the use of the back button, offer a back link with the anchor to suit

They have: 5 posts

Joined: Jun 2006

Thank you for your reply.

I'm testing my website on IE6 and Mozilla 1.7.3.

I don't know if it's a browser problem because when I use backup button in this case
http://www.mozilla.org/quality/browser/front-end/testcases/history/anchor-history.html
it works. So I don't know....

What you proposed is a good idea that came also to my mind, but problem is that for example: I'm using 4 links that point to #chapter2, so I don't know with which one an user come to #chapter2 therefore I don't know which 'back link' to create. And creating all four makes no sense.

They have: 5 posts

Joined: Jun 2006

I made a quick code inverstigation and I found following:

I'm using menu and content div with property overflow:auto. This div has fixed height. All content is then displayed in this div. All works OK but when I want to use browser history to go back it doesn't work. I founded that it's the parameter overflow:auto that causes the problem. When I delete it then the browser history works.

Is there anyway how can I achieve both, scrolling content div and functional browser history?

thanks in advance for every help.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.