我在使用Bootstrap框架时遇到了这个奇怪的问题。我决定测试Carousel功能,我在此部署了它:http://tworkimariolki.pl/beta/item.html
正如您所看到的,幻灯片放映不会“继续”,而且点击也无法正常工作。但非常奇怪的是,如果我尝试在bootply.com
上进行测试,它就能完美运行!链接:http://www.bootply.com/CRuiNa8shS
你们能解释一下为什么会这样吗?
答案 0 :(得分:4)
嗯,控制台说明了一切:
Uncaught Error: Bootstrap's JavaScript requires jQuery
更改head
元素中脚本文件的顺序,以便在bootstrap.js
之前加载jQuery:
<head>
<link href="../bootstrap/3.3.1/css/bootstrap.css" rel="stylesheet">
<link href="../bootstrap/3.3.1/css/bootstrap-theme.css" rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../bootstrap/3.3.1/js/bootstrap.js"></script>
<meta charset="utf-8">
</head>