Discuss: Drop-Down Menus, Horizontal Style
by Nick Rigby
- Editorial Comments
2 Deleted comments
When this article first went live, a small JS file got lost in the shuffle. Because the file was not present, the demo did not work during the first minutes the article was online. Alerted to the production error, we located and uploaded the missing JS file, and all was well.
One-sentence forum comments to the effect that the demo wasn’t working in Browser X, Y, or Z have been deleted. We are grateful to the first few readers whose lightning-quick posts alerted us to the problem.
posted at 05:50 am on June 29, 2004 by apartness
3 Good Article
Good article. It’s something I did a while ago on http://www.workingwith.me.uk/ from first principles – it would have been nice to have had this around then.
posted at 06:11 am on June 29, 2004 by Neil Crosby
4 Multiple nested?
Has anyone managed to do this with a multiple nested list? Now that would be interesting :)
posted at 06:24 am on June 29, 2004 by Andri
5 External files in examples should be forbidden
Would it be possible to change this?
posted at 06:24 am on June 29, 2004 by Anne
6 Improvement on the JavaScript
The Suckerfish code is very useful but can be improved to accommodate multiple uses in multiple scenarios. See below for the modified function (line wraps marked by an underscore). Once the list has been written to the browser, simply call the function below with the appropriate parameters. Thanks for the article.
———-
function fnSetHoverClass(parentID, tag,_ hoverClass) {
var el = document.getElementById(parentID);
if (el) {
el = el.getElementsByTagName(tag);
for (var i=0; i < el.length; i++) {
el[i]
posted at 06:25 am on June 29, 2004 by Tom
7 Useful
A simple, yet useful example.
This piece could be used more-or-less as-is or could easliy be expanded into something a little more visually appealing
posted at 06:26 am on June 29, 2004 by Michael Ward
8 Accessibility
A quick question: if a user has javascript disabled, but CSS enabled, does the menu work? If not, is the percentage of such users so small its not worh bothering over?
posted at 06:33 am on June 29, 2004 by guyPaulo
9 why write a duplicate article?
Why does this article exist? Isn’t this the EXACT same thing the Suckerfish article was about, except that the menu is styled horiZontally? do we really need another entire article just to figure this out?
-sorry for being a bastard :)
posted at 06:39 am on June 29, 2004 by Nick Franceschina
10 Javascript in css
Why not call the javascript from the css file using the IE only property, {behaviour:url…;}.
This would mean non IE browsers that don’t need the Javascript will not have to download irrelevant scripts.
Of course, your css won’t validate – but that’s another story.
posted at 06:43 am on June 29, 2004 by Andrew Hume
Discussion Closed
New comments are not being accepted, but you are welcome to explore what people said before we closed the door.
Got something to say?
Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.
Create a new account or sign in below if you’d like to leave a comment.
Subscribe to this article's comments: RSS (what’s this?)



1 The dutch version...
Saw something like this before on the dutch site “Naar Voren” (http://www.naarvoren.nl/artikel/hover.html). And that version works well in IE6… :) Example: http://www.naarvoren.nl/artikel/hover_cssmenu.html
posted at 05:32 am on June 29, 2004 by PeeWee