goto top

D

Desmond

Can someone tel me how I put a link at the bottom of a page to send it
to the top. Is this Javascript?

Desmond.
 
?

=?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?=

Desmond said:
Can someone tel me how I put a link at the bottom of a page to send it
to the top. Is this Javascript?

Desmond.

A frequently used method is to put the following at the very top of
your HTML files (right after the <body> tag):
<a name="top"></a>

And this near the bottom of the page to go to the top:
<a href="#top">Go to the top of the page</a>
 
S

scripts.contact

Can someone tel me how I put a link at the bottom of a page to send it
to the top. Is this Javascript?

Desmond.

JavaScript way-
window.scroll(0,0)

Mozilla Link-http://developer.mozilla.org/en/docs/DOM:window.scroll
MSDN link-http://msdn.microsoft.com/workshop/author/dhtml/reference/
methods/scroll.asp


HTML-

....
<body ..>
<a name="top">Hello WelCome</a>
.....
<a href="#top">Go to top ??</a>
 
S

scripts.contact

A frequently used method is to put the following at the very top of
your HTML files (right after the <body> tag):
<a name="top"></a>

Blank anchors are not valid.
 
D

Desmond

A frequently used method is to put the following at the very top of
your HTML files (right after the <body> tag):
<a name="top"></a>

And this near the bottom of the page to go to the top:
<a href="#top">Go to the top of the page</a>

Thanks that was simple. Des.
 
D

Desmond

JavaScript way-
window.scroll(0,0)

Mozilla Link-http://developer.mozilla.org/en/docs/DOM:window.scroll
MSDN link-http://msdn.microsoft.com/workshop/author/dhtml/reference/
methods/scroll.asp

HTML-

...
<body ..>
<a name="top">Hello WelCome</a>
....
<a href="#top">Go to top ??</a>

Java script has to be linked to a button or image right?
This would not work on a text line <a></a>

Desmond.
 
J

Jukka K. Korpela

Scripsit Desmond:
Can someone tel me how I put a link at the bottom of a page to send it
to the top. Is this Javascript?

No, it is foolish (in almost all cases, and surely if you had to ask).

Technically, it would at the simplest be the following (pure HTML):
<a href="#">Start of the current page</a>
but the foolishness results from the fact that every browser has a builtin
function for moving to the start of the current page, such as the Home key.
And you surely did not intend even to hide the useless link in a print
stylesheet, so all those links would appear on paper too.

More info: http://www.cs.tut.fi/~jkorpela/www/totop.html
 
N

Neredbojias

Scripsit Desmond:


No, it is foolish (in almost all cases, and surely if you had to ask).

Technically, it would at the simplest be the following (pure HTML):
<a href="#">Start of the current page</a>

Doesn't work in Opera without named/ided receiver.
but the foolishness results from the fact that every browser has a
builtin function for moving to the start of the current page, such as
the Home key. And you surely did not intend even to hide the useless
link in a print stylesheet, so all those links would appear on paper
too.

More info: http://www.cs.tut.fi/~jkorpela/www/totop.html

Yes, I prefer the Home key, myself.
 

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
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top