Bootstrap Carousel没有回应 [英] Bootstrap Carousel Not Responding
本文介绍了Bootstrap Carousel没有回应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的自举轮播由于某种原因无法正常工作。我已经一遍又一遍地检查了我的代码,但是我仍然无法弄清楚我的代码出了什么问题。任何帮助将不胜感激。
My bootstrap carousel is not working for some reason. I have rechecked my code again and again but I still couldn't figure out what's wrong with my code. Any help would be appreciated.
这些是我在HTML中的API调用:
These are my API Calls in my HTML:
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<script src="js/bootstrap.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.carousel').carousel()
});
</script>
这是Bootstrap Carousel的实际代码:
This is the actual code for the Bootstrap Carousel:
<div id="myCarousel" class="carousel slide"><!-- .carousel -->
<div class="carousel-inner">
<div class="active-item"><img src="images/Qatar.jpg" alt="" width="1200" style="border-radius:10px;" alt="Slide 1"/></div>
<div class="item"><img src="images/QC.jpg" alt="" width="1200" style="border-radius:10px;" alt="Slide 1"/></div>
</div>
<a class="carousel-control left" href="#myCarousel" data-slide="prev">‹</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">›</a>
</div><!-- .carousel -->
推荐答案
感谢您的建议。但是,事实证明,我的轮播无法正常工作,因为我有这样的标签:
Thank you for your suggestions. However, as it turns out, my carousel was not working because I had a tag like this:
<div class="active-item"></div>,
/ p>
when it should have been like this:
<div class="item active"></div>. Basically, my syntax was wrong.
我仍然感谢您的建议!
这篇关于Bootstrap Carousel没有回应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文