Drop Down Menu / Posts /

Make the dropdown menu accessible when JavaScript is disabled in browser

2

All working thank you.

My only issue is when the user has javascript disabled. I am thinking if I can add a link to the top menu items: <a class="top-heading" href="...">(link)</a>

If JavaScript is disabled, If the menu item is linked it will navigate to the new page;  

And if JavaScript is enabled, the link is disabled and the dropdown menu is running correctly with dropdown open/close when hovered even clicked.

Cleveland  9 years ago   viewed: 8036    

1 Answer

1

Yes you can add links to the top menu items that can be used when JavaScript is disabled:

<a class="top-heading" href="http://www.g.co" onclick="return false;">Link</a>

So when JavaScript is disabled, the onclick will not run the script "return false;" then the default nav to www.g.co will be executed.

When JS is enabled, the onclick "return false" will be executed and cancel the navigation of the link.

Milo   9 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: