简体   繁体   English

引导传送带不滑动

[英]Bootstrap carousel is not sliding

I am trying to use the bootstrap carousel but it only shows the pictures an the slides doesnt work. 我正在尝试使用自举轮播,但只显示幻灯片不起作用的图片。 The other older questions about this topic doesn't lead me to the correct solution. 有关此主题的其他较旧的问题并没有引导我找到正确的解决方案。 what im doing wrong? 我在做什么错? Iam not sure how to handle with the jquery, i think 我不知道如何处理jQuery,我认为

<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
        <ol class="carousel-indicators">
            <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
            <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
            <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
        </ol>
        <div class="carousel-inner">
            <div class="carousel-item active">
                <img class="d-block w-100" src="img/123.jpg" alt="First slide">
                <div class="container">
                    <div class="carousel-caption text-left">
                        <div align="center">
                            <p>Hier kommen Sie zur Übersicht unserer Zimmer</p>
                            <p><a th:href="@{/catalog/}" class="btn btn-primary">Zimmerbuchen</a></p>
                        </div>
            </div>
            <div class="carousel-item">
                <img class="d-block w-100" src="img/1234.jpeg" alt="Second slide">
            </div>
            <div class="carousel-item">
                <img class="d-block w-100" src="12345.jpeg" alt="Third slide">
            </div>
        </div>
        <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
            <span class="carousel-control-next-icon" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>
</body>
</html>

Have you initialized your carousel like this? 您是否已像这样初始化轮播?

<!-- Calling jquery first -->
<script language="JavaScript" type="text/javascript" src="scripts/jquery.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/bootstrap.min.js"></script>
  <!-- Carousel -->
<script language="JavaScript" type="text/javascript">
  $(document).ready(function(){
    $('.carousel').carousel({
      interval: 3000
    })
  });    
</script> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM