Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drop down without JavaScript

 
Pelle Sundqvist
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want this dropdown: http://freshdesignweb.com/demo/2012/09/drop-down-responsive-menu/ to work without JavaScript enabled in your browser. What does not work without JavaScript is submenus do not want to be seen. I want to either be able to click on the "Portfolio" or "Blog" to see the submenus or that it just works without JavaScript.
 
Rob Crowther
author
Ranch Hand
Posts: 297
5
Android Fedora Firefox Browser
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to do something on a click then you have to use JavaScript, CSS can't do anything with click events.

The original CSS only drop down menu was Suckerfish (now Son of Suckerfish), but, because they rely on :hover they don't work in oldIE without JavaScript and don't work well on touch devices.

A good approach here is to make sure that without JavaScript enabled all the menu items are visible by default, then use JavaScript to build the drop down menu out of page content, applying CSS and event handlers as necessary. You can then use the JavaScript to feature detect and tune the menu for each device/browser, but the menu will still work without JavaScript.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic