Jump to the top of the screen

D

Dave White

Hello everyone,

When I click on a menu item it will usually reference a section of the
current page.

How can I make that section jump to the top of the screen?

I haven't had any luck experimenting or finding an answer on the WWW.

Any help would be appreciated!

Dave White
 
B

BootNic

Dave White said:
news: (e-mail address removed)
Hello everyone,

When I click on a menu item it will usually reference a section of the
current page.

How can I make that section jump to the top of the screen?

I haven't had any luck experimenting or finding an answer on the WWW.

Any help would be appreciated!
http://groups.google.com/groups/search?&q=top+of+page

--
BootNic Saturday, March 31, 2007 6:18 PM

If you can learn from hard knocks, you can also learn from soft
touches.
*Carolyn Kenmore*
 
D

dorayme

Dave White said:
Hello everyone,

When I click on a menu item it will usually reference a section of the
current page.

Is this on a menu of your making? Usually, menu clicks take you
to a different page.
How can I make that section jump to the top of the screen?

Suppose the menu item refers to some sub section below that is
headed by an <h2>...</h2>. If that element is id'd

<h2 id="greatApes">The Great Apes</h2>

and the menu item at top is linked thus:

<a href="page.html#greatApes">The Great Apes</a>

where page.html is the name of the html file we are on, then
clicking should get you the heading at the top.

If it does not, post a url.
 
J

Jukka K. Korpela

Scripsit BootNic:

The question wasn't about "top of page" links (though it might easily be
misread that way, due to the somewhat strange formulation) but about a link
that points to a section (element) of the current page. The OP apparently
wants that section to appear, after following the link, at the very of the
canvas (though the confuses the canvas with the screen, perhaps because
someone made a nasty trick on his browser and prevented it from running in
any more but fullscreen :) ).

That would be a frequently asked question too, and the answer is that
normally it appears there whatever you do, except when the destination is
near the end of the page, in which case you should just accept that. (Adding
dummy content or margin at the end is not advisable.) In any case, this is a
browser feature that might (at most) be affected using something
browser-specific.
 
N

Neredbojias

Hello everyone,

When I click on a menu item it will usually reference a section of the
current page.

How can I make that section jump to the top of the screen?

I haven't had any luck experimenting or finding an answer on the WWW.

Any help would be appreciated!

Sounds like you need javascript which, as others will probably tell you in
various ways, is useless to browsers with javascript disabled.

PS: You may wish to investigate the innerHTML function or dig into styles
manipulation. Also, if page-reloading isn't a problem, this could be done
with the more viable PHP.
 

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,013
Latest member
KatriceSwa

Latest Threads

Top