Navigation Problem

R

Rose Girl

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
 
P

pcx99

Rose said:
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top