程序关闭基金会6 offCanvas

时间:2016-09-12 14:27:18

标签: javascript zurb-foundation off-canvas-menu

我想使用javascript来关闭offcanvas区域作为加载ajax脚本的结果。

文档说$('#element').foundation('close', cb);但对于#elementcb的解释方式没有太多解释:/

什么是#elementcb?你会如何以编程方式关闭他们的例子?

<body>
  <div class="off-canvas-wrapper">
    <div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
      <div class="off-canvas position-left" id="offCanvas" data-off-canvas>

        <!-- Close button -->
        <button class="close-button" aria-label="Close menu" type="button" data-close>
          <span aria-hidden="true">&times;</span>
        </button>

        <!-- Menu -->
        <ul class="vertical menu">
          <li><a href="#">Foundation</a></li>
          <li><a href="#">Dot</a></li>
          <li><a href="#">ZURB</a></li>
          <li><a href="#">Com</a></li>
          <li><a href="#">Slash</a></li>
          <li><a href="#">Sites</a></li>
        </ul>

      </div>

      <div class="off-canvas-content" data-off-canvas-content>
        <!-- Page content -->
      </div>
    </div>
  </div>
</body>

1 个答案:

答案 0 :(得分:1)

你可以用js做到这一点 $( '#offCanvas')的基础( '关闭');