Javascript 在一个页面上添加多个引导4转盘

Javascript 在一个页面上添加多个引导4转盘,javascript,html,css,bootstrap-4,Javascript,Html,Css,Bootstrap 4,我在使用新的bootstrap4时遇到了问题,你们中有人知道如何在一个页面中添加/插入多个bootstrapcarousel吗 我搜索过很多网站,但它们只使用Bootstrap3给出答案。 提前感谢您的帮助 演示页面本身使用多个旋转木马。除了用唯一的id定义每个旋转木马之外,您无需做任何特殊的事情 这是来自文档: “确保为可选控件在.carousel上设置唯一的id,尤其是在一个页面上使用多个carousel时。” 演示页面本身使用多个旋转木马。除了用唯一的id定义每个旋转木马之外,您无需做任

我在使用新的bootstrap4时遇到了问题,你们中有人知道如何在一个页面中添加/插入多个bootstrapcarousel吗

我搜索过很多网站,但它们只使用Bootstrap3给出答案。
提前感谢您的帮助

演示页面本身使用多个旋转木马。除了用唯一的id定义每个旋转木马之外,您无需做任何特殊的事情

这是来自文档:
“确保为可选控件在.carousel上设置唯一的id,尤其是在一个页面上使用多个carousel时。”


演示页面本身使用多个旋转木马。除了用唯一的id定义每个旋转木马之外,您无需做任何特殊的事情

这是来自文档:
“确保为可选控件在.carousel上设置唯一的id,尤其是在一个页面上使用多个carousel时。”


您需要为每个转盘提供唯一的ID,
有关更多信息,请访问官方bootstarp转盘文档

您需要为每个转盘提供唯一的ID,
有关更多信息,您可以访问官方bootstarp转盘文档

显示您编写的部分代码的可能副本,这将帮助我们解决您的问题显示您编写的部分代码的可能副本,这将帮助我们解决您的问题
<div id="thisShouldBeUniquePerCarousel" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner" role="listbox">
    <div class="carousel-item active">
      <img class="d-block img-fluid" src="..." alt="First slide">
    </div>
    <div class="carousel-item">
      <img class="d-block img-fluid" src="..." alt="Second slide">
    </div>
    <div class="carousel-item">
      <img class="d-block img-fluid" src="..." alt="Third slide">
    </div>
  </div>
  <a class="carousel-control-prev" href="#carouselExampleControls" 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="#carouselExampleControls" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
   </a>
</div>