SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Does a horizontal dropd down nav have to include Java script

    Buon Giorno from pitch black 9 degres C Wetherby UK :-)

    Just followed a tutorial here http://www.alistapart.com/articles/dropdowns and I notics a chunk of Javascript, heres the live result:
    http://tutorial.davidclick.com/menu.html

    Now my question is please:
    "Do you have to have a chunk of javascript to achive horizontal drop down menus?"

    Grazie Tanto,
    David
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Drop-down menus can run purely off CSS. When Eric Meyer first brought these menus to widespread attention many years ago, they were not suitable for deployment because there were too many people using IE<=6, which didn't support :hover on arbitrary elements, but thankfully those days are behind us.

    However, there are some problems with just using CSS to activate a drop-down menu, and the first and foremost is around touch-screen usage. There is no such thing as :hover on a touch screen, so you need to come up with a plan B. There are also usability issues, even for people who have the technology there, around the accuracy needed to follow the required path (especially if you have submenus coming out to the side) and the immediacy of the effect. Many people who use drop-down menus (including here at SPF) add a layer of Javascript over the top so that, while the menu will work at a basic level without Javascript, it will work even better for people who have JS activated. This can include adding in some latency to the show/hide events or enabling click-to-show rather than hover-to-show.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •