简体   繁体   English

如何使该轮播每隔“定义”秒更改一次图像?

[英]How to make this carousel change the image every 'defined' seconds?

I want the output to change the image every 3 seconds. 我希望输出每3秒更改一次图像。 I don't know how to modify the existing output. 我不知道如何修改现有的输出。 I can't find the appropriate attribute to edit. 我找不到要编辑的适当属性。

The link to the website is https://www.vimaldevelopers.com . 该网站的链接为https://www.vimaldevelopers.com Please help me in inspecting and solving this problem 请帮助我检查和解决此问题

The link to the image of the carousel https://i.imgur.com/98SsWA0.png (need 10 reputation to post the image so I have to share the link instead) 轮播图片的链接https://i.imgur.com/98SsWA0.png (发布图片需要10点信誉,因此我必须共享链接)

 carousel-item:after { content: ""; display: block; position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.1); } .carousel-inner img { width: 100%; height: 100%; } 
 <section class="container-fluid px-0"> <div class="row align-items-center"> <div class="col-lg-12 text-center sliderpaddingtop py-5"> <div class="row justify-content-center"> <!-- <div id="headingGroup" class="text-center col-10 col-lg-8 d-lg-block mt-5 pt-md-5"> --> <div id="demo" class="carousel slide" data-ride="carousel"> <ul class="carousel-indicators"> <li data-target="#demo" data-slide-to="0" class="active"></li> <li data-target="#demo" data-slide-to="1"></li> <li data-target="#demo" data-slide-to="2"></li> </ul> <div class="carousel-inner"> <div class="carousel-item active"> <img class="img-fluid" src="imgs/vc.jpg" alt="Los Angeles"> </div> <div class="carousel-item"> <img class="img-fluid" src="imgs/vh.jpg" alt="Chicago"> </div> <div class="carousel-item"> <img class="img-fluid" src="imgs/vi.jpg" alt="New York"> </div> </div> <a class="carousel-control-prev" href="#demo" data-slide="prev"> <span class="carousel-control-prev-icon"></span> </a> <a class="carousel-control-next" href="#demo" data-slide="next"> <span class="carousel-control-next-icon"></span> </a> </div> <!-- </div> --> </div> </div> </div> </section> 

You can use this I think 我想你可以用这个

$('.carousel').carousel({
  interval: 1000 * 10
});

or 要么

<div id="myCarousel" class="carousel slide" data-interval="1000" data-ride="carousel">

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

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