简体   繁体   中英

Gumby CSS framework parent anchor in dropdown on mobile

Using gumby CSS framework, when in mobile layout, the top level anchors with dropdowns are clickable. When clicked, the anchor loads a new page instead of showing the dropdowns. Has anyone encountered this problem and found a solution?

<div class="row navbar pretty" id="nav1">
  <!-- Toggle for mobile navigation, targeting the <ul> -->
  <a class="toggle" gumby-trigger="#nav1 > .row > ul" href="#"><i class="icon-menu"></i></a>
  <h1 class="four columns logo">
    <a href="#">
      <img src="/img/gumby_mainlogo.png" gumby-retina />
    </a>
  </h1>
  <ul class="eight columns">
    <li><a href="#">Features</a></li>
    <li>
      <!-- This link opens dropdown but also redirects to the href -->
      <a href="http://google.com">Documentation</a>
      <div class="dropdown">
        <ul>
          <li><a href="#">The Grid</a></li>
          <li><a href="#">UI Kit</a></li>
          <li><a href="#">Sass</a></li>
          <li><a href="#">JavaScript</a></li>
          <li><a href="#">Demo</a></li>
        </ul>
      </div>
    </li>
    <li><a href="#">Customize</a></li>
  </ul>
</div>

Your anchor was pointing to google.com instead of itself "#" Also I would try and avoid opening a div inside of a list for your css to use, instead add aclass to your lists should be:

<div class="row navbar pretty" id="nav1">
  <!-- Toggle for mobile navigation, targeting the <ul> -->
  <a class="toggle" gumby-trigger="#nav1 > .row > ul" href="#"><i class="icon-menu"></i></a>
  <h1 class="four columns logo">
    <a href="#">
      <img src="/img/gumby_mainlogo.png" gumby-retina />
    </a>
  </h1>
  <ul class="eight columns">
    <li><a href="#">Features</a></li>
    <li>
      <!-- This link opens dropdown but also redirects to the href -->
      <a href="#">Documentation</a>
        <ul class="dropdown">
          <li><a href="#">The Grid</a></li>
          <li><a href="#">UI Kit</a></li>
          <li><a href="#">Sass</a></li>
          <li><a href="#">JavaScript</a></li>
          <li><a href="#">Demo</a></li>
        </ul>
    </li>
    <li><a href="#">Customize</a></li>
  </ul>
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM