Save History of page x/y location.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ZeroFear
Forum Newbie
Posts: 14
Joined: Tue Feb 14, 2006 10:47 pm

Save History of page x/y location.

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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()
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post 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
Post Reply