传送带控制器不起作用(Carousel controllers don't work)

编程入门 行业动态 更新时间:2024-10-24 02:23:52
传送带控制器不起作用(Carousel controllers don't work)

我从Bootstrap页面复制这个轮播代码,并编辑轮播的内容。

但即使我将控制器移动到“div”元素内,控制器也不起作用。

(但如果我在只有旋转木马的空白页面中测试它,它会起作用。)

当我在我的工作页面中测试此代码时,它们不起作用

这是我的代码

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <title>Thai Chiang Mai</title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <!-- Custom fonts for this template --> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="jquery-3.2.1.min.js"> </head> <body> <div class="container"> <div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <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> <!-- Wrapper for slides --> <div class="carousel-inner"> <div class="item active"> <img src="img/food/bonchon.jpg" alt="bonchon" style="width:100%;" class="img-responsive"> </div> <div class="item"> <img src="img/food/green_curry.jpeg" alt="Curry" style="width:100%;" class="img-responsive"> </div> <div class="item"> <img src="img/food/kai.jpg" alt="Kai" style="width:100%;" class="img-responsive"> </div> </div> <a class="left carousel-control" href="#myCarousel" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#myCarousel" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> <span class="sr-only">Next</span> </a> </div>

I copy this carousel code from Bootstrap page and I edit contents of the carousel.

But controllers don't work even though I move controllers inside the " div " element.

( But it works if I test it in a blank page with only carousel.)

When I test this code in my working page , they don't work

Here is my code

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <title>Thai Chiang Mai</title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <!-- Custom fonts for this template --> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="jquery-3.2.1.min.js"> </head> <body> <div class="container"> <div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <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> <!-- Wrapper for slides --> <div class="carousel-inner"> <div class="item active"> <img src="img/food/bonchon.jpg" alt="bonchon" style="width:100%;" class="img-responsive"> </div> <div class="item"> <img src="img/food/green_curry.jpeg" alt="Curry" style="width:100%;" class="img-responsive"> </div> <div class="item"> <img src="img/food/kai.jpg" alt="Kai" style="width:100%;" class="img-responsive"> </div> </div> <a class="left carousel-control" href="#myCarousel" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#myCarousel" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> <span class="sr-only">Next</span> </a> </div>

最满意答案

在结束身体标记之前使用js和jquery。 并使用单个框架。 您正在使用两个w3和bootstrap。

Use js and jquery before ending body tag. And use single framwork. You are using two w3 and bootstrap.

更多推荐

本文发布于:2023-07-23 00:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1225207.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:传送带   控制器   不起作用   work   controllers

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!