Bootstrap传送带在本地不起作用,但可以使用在线链接

问题描述 投票:0回答:1

因此,我正在为一个学校项目的网站工作,并正在使用引导程序。我下载了bootstrap js e css文件,因此可以在本地使用,因此即使我没有Internet连接,bootstrap仍然可以使用。

一切正常,引导程序没有问题,直到我使用了转盘。由于某种原因,我的转盘无法正常工作,只会显示第一个图像。我更改了什么都没关系,没有任何效果。

然后我尝试将引导程序文件更改为引导程序网站上的在线链接,令我惊讶的是,轮播开始工作!

那么,为什么轮播仅适用于在线引导程序链接而不适用于本地引导程序文件?

下面是本地的引导文件和Web链接。我没有提供轮播html代码,因为这不是问题,因为我是从引导网站上获取的,并且它在起作用,只是不在本地。

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<!--<link href="css/style.css" rel="stylesheet" type="text/css">-->

<!-- Boostrap Minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">

<!-- Plugin jQuery -->
<!--<script src="js/jquery-3.4.1.slim.min"></script>-->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>

<!-- Bootstrap JavaScript -->
<!--<script src="js/bootstrap.min.js"></script>-->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

如果有人遇到相同的问题,并且现在要解决它,我将不胜感激!

谢谢!

html bootstrap-4
1个回答
0
投票

我怀疑您的呼叫失败,因为您没有呼叫bootstrap.bundle.min.js(带有Popper.js)。您调用了不包含popper.js的非捆绑版本(bootstrap.min.js)。

https://getbootstrap.com/docs/4.4/getting-started/contents/#css-files中讨论

© www.soinside.com 2019 - 2024. All rights reserved.