我正在使用Bootstrap内的旋转木马。我用很多不同的变化测试了这个。即使我从引导中复制并粘贴示例代码,它仍然不起作用。我已验证文件路径是准确的。控制仍然出现,但他们似乎没有任何关联。我见过一些提到“功能”的地方,但是当我在没有任何改变的情况下添加这个功能时。Bootstrap旋转木马控件
<div class="container">
<div id="myCarousel-example-generic" class="carousel slide">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="pics/01.jpg" style="max-width: 100%;" />
<div class="carousel-caption">
This should be first picture
</div>
</div>
<div class="item">
<img src="pics/02.jpg" style="max-width: 100%;" />
<div class="carousel-caption">
This should be another picture
</div>
</div>
<div class="item">
<img src="pics/03.jpg" style="max-width: 100%;" />
<div class="carousel-caption">
This is the last picture
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="icon-next"></span>
</a>
</div>
</div>
这是相关的转盘我的代码,我有下面这两个js脚本调用
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
我敢肯定,它的东西简单,但我找不到什么是错。
尝试在''
标签,而不是你的HTML之前链接到jQuery和引导JS吗?有时候你希望JS最后一次,但是当你需要整个页面结构和功能的时候不需要。如果DOM已经加载,事件处理程序可能无法工作。开发者控制台中的任何错误? – mc01在你的建议和其他答案之间,我已经解决了这个问题。非常感谢您的帮助:D – TheJakeMoony