Page 1 of 1

Save History of page x/y location.

Posted: Tue Feb 14, 2006 10:50 pm
by ZeroFear
when you hit BACK on your browser, it goes back to your previous webpage -and- scrolls to the area you were at. How it does that? I would like to "refresh/edit/delete" something on the page, and have it scroll down to where you were (x,y coordinates) when you hit the button.

Posted: Tue Feb 14, 2006 11:12 pm
by s.dot
give the element you want to scroll to an ID

such as

Code: Select all

<p id="delete">content</p>
Then to jump to that piece on a form action, use the form action http://www.domain.com/page.php#delete, and it will jump to that area.

Alternatively you could use javascript if you're always going to be going to that area, using scrollIntoView()

Posted: Tue Feb 14, 2006 11:14 pm
by josh
You can make the browser scroll to a certain part of the page using a named anchor

Code: Select all

<a name="here">test</a>
Then call the page as page.php#here