PC Review


Reply
Thread Tools Rate Thread

what code/command is required to anchor a button for top of page

 
 
=?Utf-8?B?c3Jvcms=?=
Guest
Posts: n/a
 
      8th Dec 2006
how can i anchor a button or small graphic to allow a user to return to the
top of a page
 
Reply With Quote
 
 
 
 
Trevor L.
Guest
Posts: n/a
 
      8th Dec 2006
srork wrote:
> how can i anchor a button or small graphic to allow a user to return
> to the top of a page


If the page name is "index.html", try
<a href="index.html" target="_self">top</a>
For an image, replace the text 'top' with an image.

This image could be a a button, but to generate one, use
<input type="button" value="top"
onclick="location.href='index.html'" />

By default, you will locate to the top of "index.html"
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------
 
Reply With Quote
 
Trevor L.
Guest
Posts: n/a
 
      9th Dec 2006
Andrew Murray wrote:
> Text link:
> <a href="#top">click to return to top</a>
>
> Same idea, but with an image:
> <a href="#top"><img src="top.gif"></a>
>
> "srork" <(E-Mail Removed)> wrote in message
> news:3456F02F-E74B-4F52-B396-(E-Mail Removed)...
>> how can i anchor a button or small graphic to allow a user to return
>> to the
>> top of a page


Hi Andrew,
I also thought of doing this

But it has the (slight) disadvantage that the name (#top) is appended to the
address in the address bar
e.g. on my local web, thw I sue this code, this is what is in the address
bar
file:///C:/Documents%20and%20Settings/Trevor/My%20Documents/My%20Webs/myweb/index.html#top

BTW, it relies on the fact that locating to an non-existent tag (#top) will,
by default, locate to the top of the page.

It also opens a new window (unless you add target="_self" to the <a> tag)

Just by chance I found a script which does the same thing in a few different
ways
http://nl.internet.com/c.html?rtr=on...kax8,400o,74e4

srork,
I hope you get something to work for you - it's a nice idea, and one which I
think adds to the page rather than annoys (as some can).
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------

 
Reply With Quote
 
Andrew Murray
Guest
Posts: n/a
 
      9th Dec 2006
Text link:
<a href="#top">click to return to top</a>

Same idea, but with an image:
<a href="#top"><img src="top.gif"></a>

"srork" <(E-Mail Removed)> wrote in message
news:3456F02F-E74B-4F52-B396-(E-Mail Removed)...
> how can i anchor a button or small graphic to allow a user to return to
> the
> top of a page



 
Reply With Quote
 
=?Utf-8?B?V29ya3NtYXJ0?=
Guest
Posts: n/a
 
      9th Dec 2006
Because I don't want to look at code, I highlight my Back Up text or button,
click the hyperlink toolbar button, choose the "Existing File or Web Page"
command, and click to add that page to the Address line.

Andrew, are you saying I could use this
<a href="#top">click to return to top</a>

and no matter which page I put this on, the back up command will go to top?

If so, what a timesaver! Can you explain exactly how I'd use this? If you
can, please tell me precisely where it would go. I know almost zero about
HTML and avoid even looking at it. I'm using FP 2002. Anytime I've tried to
use code someone recommends, it shows up on page in Normal view...and I know
it's something simple I'm doing wrong.

Thanks in advance.


--
Peggy Duncan, Author
Conquer Email Overload with Outlook
http://www.PeggyDuncan.com



"Andrew Murray" wrote:

> Text link:
> <a href="#top">click to return to top</a>
>
> Same idea, but with an image:
> <a href="#top"><img src="top.gif"></a>
>
> "srork" <(E-Mail Removed)> wrote in message
> news:3456F02F-E74B-4F52-B396-(E-Mail Removed)...
> > how can i anchor a button or small graphic to allow a user to return to
> > the
> > top of a page

>
>
>

 
Reply With Quote
 
Murray
Guest
Posts: n/a
 
      9th Dec 2006
Here's the best solution - assume your code is like this -

<body>
<div id="wrapper">
....Lots of content...
<a href="#wrapper">Go to top</a>

--
Murray
--------------
MVP FrontPage


"Andrew Murray" <(E-Mail Removed)> wrote in message
news:Od46$(E-Mail Removed)...
> Text link:
> <a href="#top">click to return to top</a>
>
> Same idea, but with an image:
> <a href="#top"><img src="top.gif"></a>
>
> "srork" <(E-Mail Removed)> wrote in message
> news:3456F02F-E74B-4F52-B396-(E-Mail Removed)...
>> how can i anchor a button or small graphic to allow a user to return to
>> the
>> top of a page

>
>



 
Reply With Quote
 
Murray
Guest
Posts: n/a
 
      9th Dec 2006
> and no matter which page I put this on, the back up command will go to
> top?


No.

--
Murray
--------------
MVP FrontPage


"Worksmart" <(E-Mail Removed)> wrote in message
news:FC93574D-ABFF-4102-B9C5-(E-Mail Removed)...
> Because I don't want to look at code, I highlight my Back Up text or
> button,
> click the hyperlink toolbar button, choose the "Existing File or Web Page"
> command, and click to add that page to the Address line.
>
> Andrew, are you saying I could use this
> <a href="#top">click to return to top</a>
>
> and no matter which page I put this on, the back up command will go to
> top?
>
> If so, what a timesaver! Can you explain exactly how I'd use this? If you
> can, please tell me precisely where it would go. I know almost zero about
> HTML and avoid even looking at it. I'm using FP 2002. Anytime I've tried
> to
> use code someone recommends, it shows up on page in Normal view...and I
> know
> it's something simple I'm doing wrong.
>
> Thanks in advance.
>
>
> --
> Peggy Duncan, Author
> Conquer Email Overload with Outlook
> http://www.PeggyDuncan.com
>
>
>
> "Andrew Murray" wrote:
>
>> Text link:
>> <a href="#top">click to return to top</a>
>>
>> Same idea, but with an image:
>> <a href="#top"><img src="top.gif"></a>
>>
>> "srork" <(E-Mail Removed)> wrote in message
>> news:3456F02F-E74B-4F52-B396-(E-Mail Removed)...
>> > how can i anchor a button or small graphic to allow a user to return to
>> > the
>> > top of a page

>>
>>
>>



 
Reply With Quote
 
Trevor L.
Guest
Posts: n/a
 
      10th Dec 2006
Worksmart wrote:
> Because I don't want to look at code, I highlight my Back Up text or
> button, click the hyperlink toolbar button, choose the "Existing File
> or Web Page" command, and click to add that page to the Address line.
>
> Andrew, are you saying I could use this
> <a href="#top">click to return to top</a>
>
> and no matter which page I put this on, the back up command will go
> to top?


AFAIK, if you add the code
<a href="#top">click to return to top</a>
clicking on the text will go to the top.

This causes the current window to be opened and located to the to the tag
named #top. Because this tag doesn't exist, the default will be the top of
the page.

Note
1. This opens a new page. To reopen the same page, use
<a href="#top" target="_self">click to return to top</a>

2. The reference is actually "index.html#top" (if the page is index.html)
and this will appear in your address bar. To avoid this, use
<a href="index.html" target="_self">click to return to top</a>.
This has the disadvantage that you have to tailor it for each page

I read your statement: "I don't want to look at code", but you want get too
far without understanding at least some HTML code.

It is very easy to add a link such as this. Click on HTML view (I think
that's correct for FP2002) and you will see the code. You will find that
most of is the text that you see displayed. Just find the point where you
want to add the link and paste in the code at this point. That's all there
is to it. (Of course, you have to save the file as usual.)

I also managed to do this using the menu.
Insert: Hyperlink
Address: index.html
Target Frame: same frame
Text: click to return to top
generated this
<a href="index.html" target="_self">click to return to top</a>.

--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------

 
Reply With Quote
 
Murray
Guest
Posts: n/a
 
      10th Dec 2006
I would not rely on this, Trevor. Did you look at the method I posted?

--
Murray
--------------
MVP FrontPage


"Trevor L." <Trevor_L.@Canberra> wrote in message
news:(E-Mail Removed)...
> Worksmart wrote:
>> Because I don't want to look at code, I highlight my Back Up text or
>> button, click the hyperlink toolbar button, choose the "Existing File
>> or Web Page" command, and click to add that page to the Address line.
>>
>> Andrew, are you saying I could use this
>> <a href="#top">click to return to top</a>
>>
>> and no matter which page I put this on, the back up command will go
>> to top?

>
> AFAIK, if you add the code
> <a href="#top">click to return to top</a>
> clicking on the text will go to the top.
>
> This causes the current window to be opened and located to the to the tag
> named #top. Because this tag doesn't exist, the default will be the top of
> the page.
>
> Note
> 1. This opens a new page. To reopen the same page, use
> <a href="#top" target="_self">click to return to top</a>
>
> 2. The reference is actually "index.html#top" (if the page is index.html)
> and this will appear in your address bar. To avoid this, use
> <a href="index.html" target="_self">click to return to top</a>.
> This has the disadvantage that you have to tailor it for each page
>
> I read your statement: "I don't want to look at code", but you want get
> too far without understanding at least some HTML code.
>
> It is very easy to add a link such as this. Click on HTML view (I think
> that's correct for FP2002) and you will see the code. You will find that
> most of is the text that you see displayed. Just find the point where you
> want to add the link and paste in the code at this point. That's all there
> is to it. (Of course, you have to save the file as usual.)
>
> I also managed to do this using the menu.
> Insert: Hyperlink
> Address: index.html
> Target Frame: same frame
> Text: click to return to top
> generated this
> <a href="index.html" target="_self">click to return to top</a>.
>
> --
> Cheers,
> Trevor L.
> [ Microsoft MVP - FrontPage ]
> MVPS Website: http://trevorl.mvps.org/
> ----------------------------------------
>



 
Reply With Quote
 
Trevor L.
Guest
Posts: n/a
 
      10th Dec 2006
Murray wrote:
> I would not rely on this, Trevor. Did you look at the method I
> posted?


Hi Murray,

I was replying to various posts in the stream and in the end I thought the
best way was
<a href="index.html" target="_self">click to return to top</a>.

Is this what you would recommend?
or is this better
<a href="#top" target="_self">click to return to top</a> ?
or even
<a href="index.html#top" target="_self">click to return to top</a>
(where the page is index.html)?

By now, the OP has probably decided what to use anyway

I don't use a top link much myself, but I tried the first one on my site and
it seems to work OK
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
acts like an anchor, i.e., links to another page, but looks like a button AAaron123 Microsoft ASP .NET 11 27th Nov 2008 01:01 PM
Code required for a command button =?Utf-8?B?UGF1bA==?= Microsoft Access Getting Started 1 17th Apr 2007 12:58 PM
Page Refresh button required (Macro..?) =?Utf-8?B?TW9uaw==?= Microsoft Excel Misc 0 13th Feb 2006 12:08 PM
page refresh required after back button =?Utf-8?B?RG9uSw==?= Windows XP Internet Explorer 3 16th Oct 2005 11:37 PM
Executing C code from a Command Button's code =?Utf-8?B?bmpj?= Microsoft Word Document Management 1 19th Apr 2004 10:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:17 PM.