轮播控制器不起作用



我从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>  

在结束身体标签之前,请使用JS和jQuery。并使用单个框架。您正在使用两个W3和Bootstrap。

最新更新