|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Returning to the same section of a page via 'back' button
Hey all, I'm trying to figure out how I can allow a user to link out of my site, but return to the same section if needed.
I know about named links, but I don't think that's the best solution.. or even possible for this. But I've been wrong before. I'd want to let a user click back to the same view of my site when they hit their browser's back button. Is there anything specific code related to this? If you need more info, please ask! Thanks for any leads, ryan. |
|
#2
|
|||
|
|||
|
I thought browsers remembered the scroll position automatically? IE/Win, Firefox, and Opera seem to.
It might be possible to do this in some browsers by storing the scrollTop and scrollLeft values in a cookie via onbeforeunload and then retrieving them from the cookie and setting them again via window.onload. |
|
#3
|
||||
|
||||
|
It sounds like you're referring to two things... pressing the "back" button, and linking to your page (for future viewing).
Kravvitz is correct; positioning the page while pressing back is a browser issue... most browsers know how to do it automatically, it's out of the hands of the web developer. Offering the ability to link to content (or bookmark content) half-way down a page is only possible using anchored links... An alternative altogether would be to separate your content onto multiple pages... perhaps by section or chapter or some type of logical division.
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#4
|
|||
|
|||
|
Quote:
Cool. Thanks for the info. I'm only worried about when the user links out of my site, then uses the browser's "back" button. For the case in question, the user would only be one page ahead (i.e. one click of the "back" button for the return). Could there be an issue if there are frames involved? The site has a header frame, content frame, and footer frame. For description's sake, the content frame is scrollable list of links which, when clicked, will update the content frame with details on that link. When the user hits the back button, the content frame returns to the list of links.. but always at the top of that list, instead of the last viewed location. Anchored links would work, but doesn't the user have to use the supplied <a href="previouspage.html#linkxx">Better use this back button!</a> link instead of the browser's back button? or would the anchored link affect the browser's back ability too? I think that the cookie settings is overkill, but clever. I'll give that a shot if I can't find out what's preventing the ootb browser functionality. This is a question for the current site that's being run by this gallery.. it's a all static html site, so adding all the anchors would be tedious for them.. I'm almost done coding a php/mysql site that will take care of all this for them, so this isn't a production sensitive issue and will be moot in a few months. But they asked and I'm not a HTML master.. i'm actually a content management (documentum) developer, so I like jsp and databases! Much thanks for the info, -ryan. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Development > Returning to the same section of a page via 'back' button |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|