在前面我们只是用了html和css的静态样式,学了js之后便可以在使用bootstrap并且结合jQuery来实现小网页的书写,使用时你需要引入bootstrap和jQuery,以下是我的路径

<script src="static/js/jquery-3.5.1.min.js"></script>
<script src="static/plugsin/bootstrap-3.4.1-dist/js/bootstrap.js"></script>

像之前栅格系统的下拉菜单我们也可以直接实现,只需要自己修改内容就好

但是js的有关使用还需要注意点问题,你的js有的时候是无法直接出现效果的,你必须根据它的要求绑定一些id 什么id有什么效果就在官网上都是会有说明的

这里我写了用了一个可消失弹出框,必须在里面绑定id才会有效果

<a id="example" tabindex="0" class="btn btn-lg btn-danger" role="button" data-toggle="popover" data-trigger="focus" title="Dismissible popover" data-content="And here's some amazing content. It's very engaging. Right?">可消失的弹出框</a> 

    <script>
        $(function () {
            $('[data-toggle="tooltip"]').tooltip();
            $('#example').popover('show')
        })
    </script>

更多推荐

bootstrap_js篇