Accordion Menu

优质
小牛编辑
131浏览
2023-12-01

描述 (Description)

它显示带有手风琴效果的可折叠菜单,并为自动折叠提供支持。

例子 (Example)

以下示例演示了在Foundation中使用accordion menu -

<!doctype html>
   <head>
      <meta charset = "utf-8" />
      <meta http-equiv = "x-ua-compatible" content = "ie = edge" />
      <meta name = "viewport" content = "width = device-width, initial-scale = 1.0" />
      <title>Accordion Menu</title>
      <link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
   </head>
   <body>
      <h2>Accordion Menu Example</h2>
      <ul class = "vertical menu" data-accordion-menu>
         <li><a href = "#">Two Wheeler</a>
            <ul class = "menu vertical nested is-active">
               <li><a href = "#">Honda</a>
                  <ul class = "menu vertical nested">
                     <li><a href = "#">CB Shine</a></li>
                     <li><a href = "#">Unicorn</a></li>
                     <li><a href = "#">Dream Yuga</a></li>
                  </ul>
               </li>
               <li><a href = "#">TVS</a></li>
               <li><a href = "#">Bajaj</a></li>
            </ul>
         </li>
         <li><a href = "#">Four Wheeler</a>
            <ul class = "menu vertical nested">
               <li><a href = "#">Mahindra</a></li>
               <li><a href = "#">Ford</a></li>
            </ul>
         </li>
         <li><a href = "#">Heavy Weight Vehicle</a></li>
      </ul>
      <script>
         $(document).ready(function() {
            $(document).foundation();
         })
      </script>
   </body>
</html>