簡體   English   中英

Twitter Bootstrap Carousel按鈕不起作用

[英]Twitter Bootstrap Carousel buttons not working

我正在嘗試將bootstrap 3傳送帶安裝到我的站點中,但是左右的滑動按鈕不起作用,滑動點也是如此。 誰能在我的代碼中發現問題?

<!doctype html> 
<html>
<head>
    <script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" scr="js/bootstrap.js"></script>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
    <title>Test page! </title>
</head>


<body>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="img/deepcleaning1.jpg" alt="deepcleaning">
    </div>
    <div class="item">
      <img src="img/deepcleaning2.jpg" alt="deepcleaning2">
    </div>
  </div>

  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>

</body>
</html>

聽起來與以下問題類似: Bootstrap Carousel不起作用

那里的答案建議檢查JavaScript錯誤,尤其是指向jquery的鏈接。 似乎在網址中添加http或https可以解決此問題。

<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>

要么

<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>

事實證明,由於某種原因,jquery鏈接無法正常工作...我要做的就是下載jquery文件並鏈接到該文件,而不是使用API​​。 奇跡般有效。

不知道為什么鏈接對我不起作用...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM