Click to See Complete Forum and Search --> : [RESOLVED] How Do I Create links in my blog that goto different places on the same page?
shawnsbrooks
03-05-2007, 04:05 AM
For instance:
If I had
Top Of Page.
Paragraph 1.
Bottom Of Page.
How do I turn these into links that scroll up and down?
This may be Java...
Thanks!
NogDog
03-05-2007, 04:55 AM
The simplest and most portable method is to put an ID attribute in a tag where you want a link to "jump" to. Each such ID must have a unique value, e.g.:
<h1 id='top'>Blah Blah</h1>
<h3 id='section2'>Section Two</h2>
<p id='bottom'>This is the last paragraph.</p>
Then for links to go right to those identified elements, use the "#" character in the URL:
<a href="page.html#top>Top of page</a>
<a href="page.html#section2>Jump to Section 2</a>
<a href="page.html#bottom>Skip to the end</a>
In fact, you don't even need the filename (assuming you just want to jump within the current page):
<a href="#top>Top of page</a>
shawnsbrooks
03-07-2007, 02:31 PM
thanks for the response Nogdog...
Do you know the technical term for the script I'm looking for (just out of curiousity, it works fine for me)?
Thanks again
NogDog
03-09-2007, 01:10 AM
URI Fragment Identifier
shawnsbrooks
03-12-2007, 05:07 PM
thanks! your awesome