Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scroll window after adding "top" content

Status
Not open for further replies.

yaneblog

Programmer
Jan 22, 2010
1
RU
Hi, I have a problem. Need help.
Imagine situation, user is at the bottom of some page.
Page presents document. Document consists of some parts.
User sees only last three parts.
User starts to scroll (using mouse wheel or scroll bar of browser window) to the top of the document.

I'm appending previous documents block to the top of the document. So existing blocks go down and user looses his point of view.
I'm looking for the opportunity to scroll him back to the part of the document which he was reading before appending parts.
Here is the image:

Green - existing document.
blue - appender part. I've tried to explain problem.
 
There are two main ways to achieve this...

One is using JavaScript and the scrollTo, scrollBy, or scrollIntoView methods.

The other is to use plain old HTML and jump to a bookmark (e.g. "window.location = '#someRef'").

Hope this helps,
Dan





Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top