1

It's based on this example from zurb foundation: http://foundation.zurb.com/docs/components/dropdown.html

    <a href="#" data-dropdown="drop1">Has Dropdown</a>
     <ul id="drop1" class="f-dropdown" data-dropdown-content>
      <li><a href="#">This is a link</a></li>
      <li><a href="#">This is another</a></li>
      <li><a href="#">Yet another</a></li>
     </ul>

    <a href="#" data-dropdown="drop2">Has Content Dropdown</a>
     <ul id="drop2" class="f-dropdown content" data-dropdown-content>
      <li><a href="#">This is a link</a></li>
      <li><a href="#">This is another</a></li>
      <li><a href="#">Yet another</a></li>
     </ul>

I've tried: $( ".f-dropdown").attr('data-dropdown-content');

It doesn't work.

Could this be what's preventing the child menu from not showing up?

I also have this before body tag:

         <script>
           $(document).foundation();
          </script>

This is the menu as it is so far: (got all the things inserted with the exception of this question)

     <!-- Navigation -->
       <ul class="nav menu button-group">
        <li class="item-101 current active">
           <a href="/social/services/" >Home</a>
        </li>
       <li class="item-106 deeper parent">
         <a class="programs" href="/social/services/index.php/programs-services" >Programs &amp; Services</a>
             <ul class="nav-child unstyled small">
               <li class="item-107">
                  <a href="/social/services/index.php/programs-services/child-services-link-example" >Child Services Link Example
                  </a>
              </li>
             </ul>
      </li>
      <li class="item-108">
         <a href="/social/services/index.php/featured-articles-news" >Featured Articles &amp; News</a></li>
     <li class="item-109">
         <a href="/social/services/index.php/resources" >Resources</a></li>
     <li class="item-110">
         <a href="/social/services/index.php/donate" >Donate</a></li>
     <li class="item-111">
          <a href="/social/services/index.php/contact-us" >Contact Us</a></li></ul>

  <!-- End Navigation -->

If you want further background of the question, though I don't think it necessarily pertains to this question, here's my earlier question today:How to add data-dropdown="drop1" in a menu

4

1 回答 1

1

如果您尝试使用 jQuery 将data-dropdown-content属性添加到元素:

$( ".f-dropdown").attr('data-dropdown-content');是一个吸气剂函数。你想设置属性。尝试这个:

$( ".f-dropdown").attr('data-dropdown-content', '');
于 2013-11-05T21:37:47.800 回答