Html – Dropdown menu. make it show onclick and not onmouseover

cssdrop-down-menuhtmltouchscreen

I'm using this Dynamic Drive dropdown menu ( http://www.dynamicdrive.com/dynamicindex1/chrome/ —- js source at http://www.dynamicdrive.com/dynamicindex1/chrome/chromejs/chrome.js ) on my page.

The author says: All event handlers added to the menu are now unobstrusive, allowing you to define your own "onmouseover" or "onclick" events on the menu items (but he doesn't explain how to newbies like me).

Here's a bit part of the code:

<div class="chromestyle" id="chromemenu">
    <ul>
        <li><h2><a href="#" rel="dropmenu1">Me&amp;myself</a></h2></li>
        <li><h2><a href="#" rel="dropmenu2">Napoli</a></h2></li>
        <li><h2><a href="#" rel="dropmenu3">Technology</a></h2></li>
        <li><h2><a href="/ufo.php">UFO</a></h2></li>
        <li><h2><a href="#" rel="dropmenu4">Anime</a></h2></li>
        <li><h2><a href="/maps/map.php">Cartine geografiche</a></h2></li>
        <li><h2><a href="/calcio.php">Il calcio</a></h2></li>
    </ul>
</div>

<!--1st drop down menu -->                                                   
    <div id="dropmenu1" class="dropmenudiv">
    <a href="/">.: Home</a>
    <a href="/interess.php">.: About me</a>
    <a href="/blog/">.: My Blog</a>
    <a href="/gallery/">.: My Photo Gallery</a>
    <a href="/guestbook/guestbook.php">.: My Guestbook</a>
</div>

The problem is that touchscreen devices can't show drop down menus because you don't have a mouse and you can only tap on the screen, hence why I want to make the drop down menus clickable, now that I have written a proper mobile css stylesheet.

I googled without luck, and tried substituting onclick="" to rel="" but unfortunately it didn't work.

Any hints?
Thanks in advance

Best Answer

The js for this drop down menu seems to have been last updated in 2008 so be a little cautious as to its compatibility with modern browsers and technologies.

I would suggest googling for a more recent drop down js solution.

OR

you could take a look at this list of drop down solutions ( http://www.1stwebdesigner.com/css/38-jquery-and-css-drop-down-multi-level-menu-solutions/ ) the list was updated only last month, have a good look through and you might find a better solution than the Dynamic Drive drop down.

Related Topic