Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript “关闭画布”菜单根据条件关闭幻灯片上的动画_Javascript_Css_Zurb Foundation - Fatal编程技术网

Javascript “关闭画布”菜单根据条件关闭幻灯片上的动画

Javascript “关闭画布”菜单根据条件关闭幻灯片上的动画,javascript,css,zurb-foundation,Javascript,Css,Zurb Foundation,目前我正在从事一个类似于此示例的项目: HTML: JS: 我使用非画布在页面上显示菜单。然而,基于某些条件,我喜欢关闭动画,只是菜单弹出,没有任何动画,然后根据其他条件打开动画 那可能吗 <div class="off-canvas-wrap" data-offcanvas> <div class="inner-wrap"> <a class="left-off-canvas-toggle" href="#" >Menu</a>

目前我正在从事一个类似于此示例的项目:

HTML:

JS:

我使用非画布在页面上显示菜单。然而,基于某些条件,我喜欢关闭动画,只是菜单弹出,没有任何动画,然后根据其他条件打开动画

那可能吗

 <div class="off-canvas-wrap" data-offcanvas>
  <div class="inner-wrap">

    <a class="left-off-canvas-toggle" href="#" >Menu</a>

    <!-- Off Canvas Menu -->
    <aside class="left-off-canvas-menu">
        <!-- whatever you want goes here -->
        <ul>
          <li><a href="#">Item 1</a></li>
        ...
        </ul>
    </aside>

    <!-- main content goes here -->
    <p>Set in the year 0 F.E. ("Foundation Era"), The Psychohistorians opens on Trantor, the capital of the 12,000-year-old Galactic Empire. Though the empire appears stable and powerful, it is slowly decaying in ways that parallel the decline of the Western Roman Empire. Hari Seldon, a mathematician and psychologist, has developed psychohistory, a new field of science and psychology that equates all possibilities in large societies to mathematics, allowing for the prediction of future events.</p>

  <!-- close the off-canvas menu -->
  <a class="exit-off-canvas"></a>

  </div>
</div>
    .left-off-canvas-menu {
  height: 100vh;
}
$(document).foundation();

$('.off-canvas-wrap').foundation('offcanvas', 'show', 'move-right');
$('.off-canvas-wrap').foundation('offcanvas', 'hide', 'move-right');
$('.off-canvas-wrap').foundation('offcanvas', 'toggle', 'move-right');