title: Disable anchor menu click on mobile devices
body: <p>I'm using a nested list as a menu with sub menu items. I used to do it where if you hovered over main menu item, the sub menu items would appear by changing the display from none to block.
  I decided to make the sub menus looks as if they were dropping down and used CSS transitions.</p>
  
  <p>The problem I have is that in the first approach if you touched a main menu item on an iPad the sub menu would display and you would touch it again to follow the link.
  With the new approach it follows the link on the iPad and you don't get to see the sub menu.</p>
  
  <p>The menus that have nothing below them (sub menu items and main menu items with no sub menu items) have one class while the main menu items with a sub menu below them have a different class.</p>
  
  <p>Is there any way I can set it so that hovering over the menu would show the sub menu items on a desktop and clicking would follow the link while touching a main menu item on an iPad would follow the link if there was no sub menu items but follow the link on a second touch and show the sub menu on the first touch when there is a sub menu?</p>
  
  <pre><code>    &lt;div id="menu"&gt;
      &lt;div class="mainmenu"&gt;
           &lt;ul&gt;
              &lt;li class='menu_child'&gt;
                  &lt;a href=''&gt;Home&lt;/a&gt;
              &lt;/li&gt;
              &lt;li class='menu_child'&gt;
                  &lt;a href=''&gt;Blog&lt;/a&gt;
              &lt;/li&gt;
              &lt;li class='menu_parent'&gt;
                  &lt;a href=''&gt;Contact Us&lt;/a&gt;
                  &lt;ul&gt;
                      &lt;li&gt;
                          &lt;a href='' &gt;Find Us&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;a href='' &gt;About Us&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;a href='' &gt;Meet the Team&lt;/a&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li class='menu_parent'&gt;
              &lt;a href=''  &gt;Adventure&lt;/a&gt;
              &lt;ul&gt;
                  &lt;li&gt;
                      &lt;a href='' &gt;Adventurer Grandmaster&lt;/a&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li class='menu_child'&gt;
              &lt;a href='' &gt;Guilds&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class='menu_parent'&gt;
              &lt;a href='' &gt;Trade&lt;/a&gt;
              &lt;ul&gt;
                  &lt;li&gt;
                      &lt;a href='' &gt;Moonsea&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;a href='' &gt;Hillsfar&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;a href='' &gt;Femphrey&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;a href='' &gt;Anvil&lt;/a&gt;
                  &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>First approach</p>
  
  <pre><code>    .mainmenu ul ul{
  float: left;
  padding: 0;
  position: absolute;
  text-align: left;
  width: 274px;
  z-index: 1001;
  display: none;
  }
  
  .mainmenu ul li:hover ul, .mainmenu li.over ul {
  display: block;
  }
  </code></pre>
  
  <p>Second approach</p>
  
  <pre><code>.mainmenu ul ul{
  float: left;
  padding: 0;
  position: absolute;
  text-align: left;
  width: 274px;
  z-index: 1001;
      height: auto;
  max-height: 0;
  overflow: hidden;
  -webkit-transition: max-height 0.3s ease-in;
      -moz-transition: max-height 0.3s ease-in;
      -o-transition: max-height 0.3s ease-in;
      -ms-transition: max-height 0.3s ease-in;
      transition: max-height 0.3s ease-in;
  }
  
  .mainmenu ul li:hover ul, .mainmenu li.over ul{
  max-height: 999px;
  -webkit-transition-duration:1s;
      -moz-transition-duration:1s;
      -o-transition-duration:1s;
      -ms-transition-duration:1s;
      transition-duration:1s;
  }
  </code></pre>
  
  <p>I've adding focus and active pseudo-classes to the hover bit.</p>
  
  <p>I'm willing to use JavaScript but I'd rather do it with CSS, preferably without changing the HTML. I'm willing to use PHP as a last resort.</p>