gpt4 book ai didi

carousel - Bootstrap 4 Carousel slider 不起作用

转载 作者:行者123 更新时间:2023-12-03 22:45:04 26 4
gpt4 key购买 nike

关闭。这个问题需要 details or clarity 。它目前不接受答案。












想改进这个问题?添加详细信息并通过 editing this post 澄清问题。

4年前关闭。
社区在 29 天前审查了是否重新打开此问题并将其关闭:

原始关闭原因未解决





Improve this question




我在通过轮播进入下一张幻灯片时遇到了一些严重的问题。我可能遗漏了一些非常基本的东西,但无论我做什么,它似乎都不起作用!我也尝试过使用Javascript,但无济于事。

            <div id="mycarousel" class="carousel-slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active text-center p-4">
<h1 class="header-h1">WE'RE READY, ARE YOU? </h1>
<H2 class="header-h2">COME AND JOIN US FOR A SHOOT</H2>
<a href="/" class="btn btn-default">FIND OUT MORE</a>
</div>
<div class="carousel-item text-center p-4">
<h1 class="header-h1">COME AND </h1>
<H2 class="header-h2">HAVE</H2>
<a href="/" class="btn btn-default">A GO</a></p>
</div>
</div>
<a class="carousel-control-prev" href="#mycarousel" 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="#mycarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>

最佳答案

使用以下工作轮播 slider 模板作为起点(包括所有 CDN 文件,其顺序与您在模板中看到的完全相同),然后开始用您自己的内容一一替换该模板的部分内容。

一次只做一件,一旦你添加的东西破坏了整个事情,你就会立即知道罪魁祸首。

这是工作模板(单击下面的“运行代码片段”按钮并展开到整页):

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

<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="https://placeimg.com/1080/500/animals" alt="First slide">
<div class="carousel-caption d-none d-md-block">
<h5>My Caption Title (1st Image)</h5>
<p>The whole caption will only show up if the screen is at least medium size.</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://placeimg.com/1080/500/arch" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://placeimg.com/1080/500/nature" 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>

关于carousel - Bootstrap 4 Carousel slider 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48824568/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com