469,917 Members | 2,157 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

Navigation Problem

Hi,

This may be a simple problem, but i need some help on this.

When i load a new page, i want it to automatically navigate to a specific
position in the page. (like a hyperlink to a heading in the page)

How can i do this.

Thanks for your help
Rose Girl
Jul 23 '05 #1
1 919
Rose Girl wrote:
Hi,

This may be a simple problem, but i need some help on this.

When i load a new page, i want it to automatically navigate to a specific
position in the page. (like a hyperlink to a heading in the page)

How can i do this.

Thanks for your help
Rose Girl

window.scrollto(x,y);

window.scrollto(0,0) will scroll to the top.

window.scrollto(0,1000) will scroll 1,000 pixels down.

To scroll to a specific element you'll need to calculate the position of
that element. There's a prettygood script here:
http://www.quirksmode.org/js/findpos.html

A much SIMPLER way to do this is to simply use the <A NAME="marker"></A>
tag and then at the bottom of your document put...

window.location.href="pagename.html#marker" where pagename.html is the
name of your page and #marker is the name of your name tag.

Good luck!

-------------
http://www.hunlock.com -- DHTML for the rest of us.
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Dave Patton | last post: by
9 posts views Thread by Theodore A. Jencks | last post: by
3 posts views Thread by eternalD3 | last post: by
reply views Thread by Veli-Pekka Tštilš | last post: by
10 posts views Thread by RodBillett | last post: by
10 posts views Thread by EA | last post: by
reply views Thread by emalcolm_FLA | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.