Bootstrap Overlay菜单更改拖动按钮?

时间:2017-08-03 05:44:30

标签: javascript jquery css twitter-bootstrap shopify

好的,所以我在Bootstrap中制作了一个叠加菜单。问题是,当模态打开时,我试图用FAIL __tests__/homepage.test.js ● adds 1 + 2 to equal 3 ReferenceError: Homepage is not defined at Object.<anonymous> (__tests__/homepage.test.js:4:12) at Promise.resolve.then.el (node_modules/p-map/index.js:42:16) at process._tickCallback (internal/process/next_tick.js:109:7) ✕ adds 1 + 2 to equal 3 (2ms) Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 3.138s, estimated 11s 替换.ion-drag类,并在模态关闭时返回.ion-close。我如何在jQuery中做到这一点?到目前为止,互联网上的每个解决方案都无法运作。

我的网站:https://filthdemo.myshopify.com

2 个答案:

答案 0 :(得分:0)

试一试,在打开模态之前只保留$('.boxed a').toggleClass('ion-drag is-closed')

[(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (4, 0), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (5, 0), (5, 1), (5, 2), (5, 3), (5, 4), (5, 5)]

答案 1 :(得分:0)

<head>

中添加这些行
<!-- Scripts -->
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
<script>
  $('#toggle').click(function() {
  $(this).toggleClass('toggle-active');
  $('#overlay').toggleClass('nav-active');
  });
</script>

并将您的<header>更改为

<header>
    <div class="navbar-header">
        <div class="toggle-button" id="toggle">
            <span class="bar top"></span>
            <span class="bar middle"></span>
            <span class="bar bottom"></span>
        </div>
    </div>
    <nav class="overlay" id="overlay">
        <ul>
            <li><a href="#">Our Story</a></li>
            <li><a href="#">Events</a></li>
            <li><a href="#">Information</a></li>
            <li><a href="#">ARTICLES</a></li>
            <li><a href="#">HELP</a></li>
        </ul>
    </nav>
</header>