问题描述
必须先手动按箭头使其换一张图片才能正常进行自动轮播,否则无法进行自动轮播。
用的bootstrap的轮播组件,不知道问题在哪
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
<div id="myCarousel" class="carousel slide" style="width: 200px;margin: auto">
<!-- 轮播(Carousel)指标 -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- 轮播(Carousel)项目 -->
<div class="carousel-inner">
<div class="item active">
<img src="image/timg.jpg" alt="First slide">
<div class="carousel-caption">标题 1</div>
</div>
<div class="item">
<img src="image/timg.jpg" alt="Second slide">
<div class="carousel-caption">标题 2</div>
</div>
<div class="item">
<img src="image/timg.jpg" alt="Third slide">
<div class="carousel-caption">标题 3</div>
</div>
</div>
<!-- 轮播(Carousel)导航 -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<body>
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
你期待的结果是什么?实际看到的错误信息又是什么?
富国沪深
相关分类