On 11 Nov 2005 13:03:42 -0800,
wrote:
> [snip - using select for a menu]
> There are 11 sections listed (less the first line, which is just a
> title "Portfolio Index"). But only 10 lines appear when the drop down
> is selected. I would like them all to show in the box (and I may add
> another line or two).
>
> Secondly, after each section on the page, I have a jump back link to
> the top of the page. When this is done, the drop down shows the last
> section selected. I would like to force it to show the top line,
> "Portfolio Index" each time.
Select elements behave like this because they were designed for use in
forms. I'm sure your second problem can be fixed in Javascript (I'll leave
it to another poster to say how), but your first problem is due to a design
decision on the part of the browser makers (to make forms usable) and
cannot be overridden. The solution is to use a div element for the
drop-down menu, rather than a select element. Here's a very simple way
(that is, it uses very little code) of doing a menu using divs that also
degrades nicely:
http://www.safalra.com/programming/j.../dropdown.html
--
Safalra (Stephen Morley)
http://www.safalra.com/programming/javascript/