CSS Multi Level Menus? Or Pure Javascript?

Discussion in 'HTML & Website Design' started by 2blind2c#, Nov 10, 2007.

  1. #1
    Hello all!

    I have a question,

    You see I have a site which I pretty much use a multi-level menu for site navigation & so far it's serving the purpose of navigation & alot of flexibility for looks & all of that fun stuff. My concern? Well, it pretty much is entirely writen in JS thus I'm not sure how friendly it'll be with search spiders & people's browsers (though I tested it in FF, Opera, IE6 and even Safari with no problems with it). As far as search spiders & them completely ignoring JS I pretty much have noscript tags which points to all of the links in my site.

    Even though there's some safeguards against each of my concerns I'm wondering if there's any good/flexible/equally effective CSS solutions for multi level navigation menus (horizontal especially) or if I'm really ok with the JS menus that I can generate.
     
    2blind2c#, Nov 10, 2007 IP
  2. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #2
    There's no avoiding the use of JS, as you'll have to use the onmouseover event handler to give/change a class on list item elements (LIs) to support MSIE6 since it doesnt support :hover on anything but anchors.
     
    soulscratch, Nov 10, 2007 IP
  3. 2blind2c#

    2blind2c# Peon

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thans for feedback,
    Well, I'm kind of aware that 'some' js may be necessary.. I guess to narrow down all my mumbling what I'm mainly wondering is if having a menu mostly composed of JS is a good idea as opposed to a menu that mainly relies on CSS.
     
    2blind2c#, Nov 10, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Nope, a CSS based menu using an unordered list for the menu items is your best bet here, not only for accessibility but also for search engine spiders as well. If you're leery of using an external JavaScript file (and calling it via a script element), you can use a .htc file, but you'll have to ensure that your server is set up to send the proper MIME type for .hta and .htc files.

    http://www.xs4all.nl/~peterned/csshover.html
     
    Dan Schulz, Nov 11, 2007 IP