-1

当我将我的网络浏览器变小时,我找不到为什么无法使用按钮的原因?

我尝试在互联网上查找,但找不到解决方案

<nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button class="navbar-toggler  navbar-toggler-right" type="button" aria-controls="#ex1" aria-expanded="false" aria-label="Toggle navigation" data-toggle="collapse" data-target="ex1">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">לוגו</a>
                </div>

                <div class="collapse navbar-collapse" id="ex1">
                    <ul class="nav navbar-nav navbar-right">
                        <li class="active"><a class="nav-link" href="#">דף הבית</a></li>
                        <li class="nav-item"><a class="nav-link" href="#">Link</a></li>
                        <li class="nav-item"><a class="nav-link" href="#">Link</a></li>
                        <li class="nav-item"><a class="nav-link" href="#">Link</a></li>
                        <li class="nav-item"><a class="nav-link" href="#">Link</a></li>
                    </ul>
                </div>
            </div>
        </nav>
4

3 回答 3

0

Make sure you added this three scripts in exact this order:

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

It is jQuery, than popper.js, than the bootstrap.min.js It is important that you load jQuery at first and bootstrap.min.js at last, while popper.js is in between

于 2020-02-14T08:17:39.107 回答
0

首先,您需要确保所有文件都正确连接。如果所有文件都正常,请尝试使用此答案中的降价。

于 2018-01-09T10:10:36.900 回答
0

很可能,您在添加引导程序的 JS 文件之前还没有添加 jQuery。Bootstrap 的 js 代码依赖于 jQuery,所以需要添加 jQuery,后面应该跟着 bootstrap 的 js 文件(很可能是 bootstrap.min.js)

于 2018-01-09T10:08:16.317 回答