Hymer wrote:
Hello,
I have a blog with all of the archives contained in a drop down menu. At the
end of the page, I have a "More Articles" link which I want to link to the
Archives Menu. I just want to hyperlink More Articles to the On-Page
Archives Menu.
The Archive Menu is script written by someone else and I can't see where to
put the ID so it associates with the menu. The script is shown below.
I am using:
<a href="#archive">More Articles</a and
<p id="archives"xxxxxxxxx </p>
Can anyone see how to set this up so More Articles jumps to the Archives
Menu?
Thanks a lot,
Bob
---
<MainOrArchivePage>
<select name="archivemenu" onchange=
"document.location.href=this.options[this.selectedIndex].value;">
<option selected="selected">- Archives -</option>
<BloggerArchives>
<option value="<$BlogArchiveURL$>"><$BlogArchiveName$></option>
</BloggerArchives>
</select>
</div>
Hymer,
I think you've complicated things as a result of a simple typographical
error. You create a paragraph and assign it an ID of 'archives'
(plural), then try to refer to it with href="#archive" (singular). To a
browser, those two strings are as different as "cat" and "dog".
You've also forced us to guess where you PUT the <pand it isn't
present in the URL you provided in a later post. In the future, you
should post a URL which actually contains the code that your tried, but
could not get to work. That let's us really see what is wrong.
In this case, however, the solution is simple. Your archive is
represented as a Select list, which starts, in the HTML, with a select
element. That's where you want the user to be taken when they click on
your "Archives", so all you have to do is give it an ID (must be unique
on the page), thus:
<select id="archives" name="archivemenu" ....
Your link should then refer to this ID, thus:
<a href="#archives">MORE ARTICLES...</a>
[Tested with IE 6 and Firefox]
NO need for an enclosing paragraph, unless you are prevented by the
mechanics of your tools from adding the id= to the <select>.
Why doesn't the name= on the select work as a target, i.e. why can't you
say <a href="#archivemenu">MORE ARTICLES...</a>? Because name= means
different things depending on which element it is used within. It
becomes a target ONLY when used on the anchor (<a>) element. For a
<select>, the name= value becomes the 'control name' for the select;
this name is passed to the server along with the currently selected
value, so the server can pick out the right archive, but it has no
effect on the browser.
id= ALWAYS specifies an identifier that can be used as a target, so it's
the better attribute to use.
Chris Beall