0

I'm developing a website with rather long pages, where the user can click on hyperlinks to scroll up/down to elements of interest. This scrolling is done smoothly (using jQuery), to help maintain positional awareness and to indicate to the user that they remain on the same page.

After the scrolling animation is over, a return false statement prevents the default action of the <a href="#section"> hyperlink. In other words, the url doesn't change from www.example.com/page to www.example.com/page#section as it would otherwise do.

Personally, I prefer it this way. I find it cumbersome to press the back button several times to go to the previous page. But is it considered bad practice to prevent the default (and hence expected) behaviour? Does it matter whether this scrolling is instantaneous or animated?

Thanks.

2

The issue here is not working within the page but working with other pages.

What does the user expect to happen when they click the back button?

For internal links where no positional awareness is maintained the user will usually assume they have changed pages and will want the back button to show them the last view they had before clicking the internal link.

For the scenario you outlined (visibly scrolling the page to the chosen point) I would suggest the back button should take the user to the previous page rather than the previous scroll position.

To summarize this article: If it looks or feels like a new page then the user should be able to retrieve the previous state using the back button.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.